49,756 Topics

Member Avatar for
Member Avatar for andimiami

In my function, I am using .find and I need to be using .at, because the way I have it now doesn't account for extra whitespace etc., but I have no idea how to implement this change. I looked through the internet and I can't find a good example of …

Member Avatar for andimiami
0
119
Member Avatar for clickspiker23

I am supposed to read in data from a file and store it. I know how to read from a file and display it, in main, what i don't understand is how to do that with classes and objects. This is the part im having a little trouble with and …

Member Avatar for jjman4562
0
168
Member Avatar for rattlesnake_bac

Hello, i need a simple C/C++ program that sends SMSs via the attached GSM modem. I have some experience in C programming, but i haven't controlled the COM port. Also, i need to give 2 variables , one for the recipient's number, and second for the actual message. So, when …

Member Avatar for sunnythesun
0
816
Member Avatar for Khoanyneosr

So, I've bought two books, one on DirectX 10 and one on OpenGL. The first one i bought was the directX 10 book, and NONE of the code compiled because of some LPCSTR error. So stupid me thinking it was another thing that microsoft goofed on i bought a book …

Member Avatar for pseudorandom21
0
325
Member Avatar for dodgers

Hey. My program wont write the input data to file. It seems like the userdata variabels doesnt get updated after input from the user. Can anyone see what i have done wrong? This is what i have done so far: [CODE] // userdata.cpp // class userdata store user information #include …

Member Avatar for Moschops
0
165
Member Avatar for inzombiak

Hey, let me try explaining what i need to do with an example Example Before sorting arr1 = {15,12,18,11} arr2 = {1,2,3,4} arr2 is always in ascending order and its length is based on the number of elements in arr1 After sorting arr2 = {2,3,1,4} So basically i need arr2 …

Member Avatar for thekashyap
0
131
Member Avatar for thekashyap

Hi, I was implementing the Exampler / Prototype pattern just to brush up on C++. Couldn't figure out how to do the cleanup at the end. Problem is deleting all the prototypes from the map in base class at the end. I.e. deleting all stored pointers in [ICODE]Animal::examplesPtr[/ICODE], which is …

Member Avatar for thekashyap
0
100
Member Avatar for Khoanyneosr

[CODE]#ifdef _WIN32 #include <windows.h> #endif #include <iostream> #include <vector> #include <string> #include <SDL/SDL.h> #include <GL/gl.h> #include <GL/glu.h> using std::vector; void error(const std::string& s) { #ifdef _WIN32 MessageBox(NULL, s.c_str(), "An error occurred", MB_ICONINFORMATION | MB_OK); #else std::cerr << s << std::endl; #endif } [/CODE] That's my problem... [CODE]1>------ Build started: Project: …

Member Avatar for Khoanyneosr
0
199
Member Avatar for pepperhead11

Ok, I've been trying to run this program on Borland C++ (Version 5.0A). The program is a Point of Sale program. I keep getting the errors "expression syntax at (121,26)" and "If statement missing ) at (129,6). Try as I might, I can't seem to fix the errors. Help? [CODE] …

Member Avatar for WaltP
0
1K
Member Avatar for gcardonav

Hi guys: I created this program that will read into two files and compare a number from one file into the other and if they match, it will print out some information. I ave two if statements and it seems that the second one can't be read. I tried putting …

Member Avatar for WaltP
0
209
Member Avatar for Sonia11

I ma brand new to templates and I have been given an exercise to reverse the elements using vectors which I did perfectly. But I need to include the template thing which I tried my level best to understand and do but still I am getting many errors. Any help …

Member Avatar for L7Sqr
0
170
Member Avatar for NoUserNameHere
Member Avatar for NoUserNameHere
0
120
Member Avatar for AliRaiz

first my task was to write this program that checks that string t contained in string s or not and i successfully made it and now i have to change this program a little bit and now i have to use a bool function in this program any one can …

Member Avatar for AliRaiz
0
96
Member Avatar for jimJohnson

I am finishing up this program and need to find the GCD using euclids formula. I am attaching my code and was seeing if anyone could show me what is wrong. I am also sending the instructions just in case you need it... [code] //Programmed by: Bryan Kruep //Date: 2/22/2010 …

Member Avatar for jimJohnson
0
348
Member Avatar for clickspiker23

i keep getting this error in my main.cpp [code]main.cpp:17: undefined reference to `Game::Game()'[/code] this is the code i have pertaining to the error [code] #include "Game.h" #include<iostream> #include<cstring> #include<iomanip> #include<cctype> #include<fstream> #include<string> int main() { ifstream din; Game output; output.fillGame(din); return 0; } [/code] i doubt it but just in …

Member Avatar for clickspiker23
0
139
Member Avatar for caut_baia

[code] class A { virtual void func()=0; }; class B : public A { void func (); }; class C : virtual public B { void func(); }; //I receive an A* pointer through a function in an LPARAM type argument //and i must downcast from an A* to a …

0
63
Member Avatar for andimiami

I need to take an input file that contains name listed like: John Henry Mary Baker and create an output that looks like: Baker, Mary. Henry, John. Right now my output is just ,. ,. ,. ,. ,. ,. I can't use any global accesses, or a character processing alogorithm. …

Member Avatar for Moschops
0
131
Member Avatar for prahesh

Hi All, I want to register the .dll files in my setup project. I am creating the Setup project for installing it on 64 bit Windows 7 machine, And I have successfully installed on 64 bit Machine. The issue is, while running the application installed on the 64 bit machine, …

Member Avatar for prahesh
0
627
Member Avatar for failbot

Hi, I am working on this code: [CODE]#include <iostream> using namespace std; send(to, from, count) { register int *to, *from; register int count; { register n=(count+7)/8; switch(count%8){ case 0: do{ *to++ = *from++; case 7: *to++ = *from++; case 6: *to++ = *from++; case 5: *to++ = *from++; case 4: …

Member Avatar for failbot
0
224
Member Avatar for clickspiker23

Im trying to read from a file using classes and objects. i keep getting this error [CODE]main.cpp:16: error: no matching function for call to ‘Game::fillGame()’ Game.h:41: note: candidates are: bool Game::fillGame(std::ifstream&)[/CODE] here is code that goes with the error [CODE] //Game.h bool fillGame(ifstream & din); [/CODE] [CODE] //Game.cpp #include<iostream> #include …

Member Avatar for jonsca
0
137
Member Avatar for munitjsr2

[CODE] #include <iostream> #include <vector> #include <algorithm> using namespace std; class A { public : void getData(vector< A > &); void putData(vector< A > &); private : int x; char name[90]; }; vector< A > v; void A :: getData(vector< A > &Aref) { cout << "id = "; cin …

Member Avatar for munitjsr2
0
238
Member Avatar for narunaru

Hi, I'm a beginner programmer and I have an assignement of making the radix sort! My plan is to make a helper function that will return the place value of a number. (for example, if the number is 127, then the function will return either a 1, 2 or 7) …

0
58
Member Avatar for Robbie Y.

Hey guys! I'm trying to write a program that involves a switch/case on Microsoft Visual Studion 2010. Unfortunately, some of my variables are not being initialized. I am a very novie programmer so please have mercy on me! Two of my options (1,4) are working but options (2,3) are not. …

Member Avatar for Robbie Y.
0
169
Member Avatar for bensewards

Hey everyone, I'm new at visual c++ and MFC Applications, and so I am going through Ivor Horton's Beginning Visual C++ 2010 to make a drawing application through Microsoft Foundation Class. I added menu bars for options, such as shape(rectangle, line, and ellipse) and select colors (black, red, blue green). …

Member Avatar for bensewards
0
280
Member Avatar for cppjosh

Hey everyone! I was recently assigned this program in class and have only finished about half the work but am already very confused. I was just hoping that some of you could give it a shot and share what kind of code you came up with. Well here it is …

Member Avatar for pseudorandom21
0
117
Member Avatar for SillySpAz

I keep getting an output of zero, I don't know what's wrong.. #include <iostream> using namespace std; double determineCommissionRate(double totalCommission, double totalSales); double determineBasePay(double basePay, double yearsWorked); int main() { double yearsWorked, totalSales, totalPay, totalCommission, basePay; cout << "Please enter the number of years you have worked at this company" …

Member Avatar for SillySpAz
0
126
Member Avatar for jowana

Hello, I have a line on my image and i want to find the maximim grey-level value on that line . so i need to scan the line and pick the pixel with the highest value how can I do this? should I calculat the gradient magnitude ? Thanks in …

Member Avatar for jowana
0
120
Member Avatar for lochnessmonster

Local * pLocal = *(Local**)0xE6EB54; // valid How would u interpret these in english i understand it has to do with a pointer to a double pointer? Local * pLocal = (Local**)0xE6EB54; // not sure if this is even valid if the above is valid as well how would u …

Member Avatar for mike_2000_17
0
91
Member Avatar for Mr. K
Member Avatar for andimiami

I am doing a program involving an unsorted list of names that I have to turn form Firstname Lastname into Lastname, Firstname. So I wrote the main program, and my instructor told me that under my getList function, to retrieve the data just do data >> first and data >> …

Member Avatar for Greywolf333
0
133

The End.