Click here to Skip to main content
16,005,094 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Hide Mouse Pin
Robert A. T. Káldy16-Feb-04 7:38
Robert A. T. Káldy16-Feb-04 7:38 
QuestionFile length macro??? Pin
PJ Arends14-Feb-04 13:28
professionalPJ Arends14-Feb-04 13:28 
AnswerRe: File length macro??? Pin
Michael Dunn14-Feb-04 14:10
sitebuilderMichael Dunn14-Feb-04 14:10 
GeneralRe: File length macro??? Pin
PJ Arends14-Feb-04 14:15
professionalPJ Arends14-Feb-04 14:15 
GeneralLNK1181...'shlwapi. newbie Pin
~toki14-Feb-04 10:54
~toki14-Feb-04 10:54 
GeneralRe: LNK1181...'shlwapi. newbie Pin
Tim Smith14-Feb-04 12:59
Tim Smith14-Feb-04 12:59 
GeneralRe: LNK1181...'shlwapi. newbie Pin
Michael Dunn14-Feb-04 14:12
sitebuilderMichael Dunn14-Feb-04 14:12 
Generalinfinite loop Pin
4ize14-Feb-04 10:50
4ize14-Feb-04 10:50 
hi
i am having a problem with an infinite loop
can someone check out the code and tell me
what is wrong with it...
[code]
int main()
{
int numberOfResponses; //number of responses for candidates
int accumulator = 0; //adds up total number of votes

do
{
char* stateName = new char[30]; //char pointer array for stateName
char* dateOfPrimary = new char [30]; //char pointer array for date of primary

cin.getline(stateName,30) ;
cin.getline(dateOfPrimary,30);
cin >> numberOfCandidates;

primaries NewPrimary(stateName,dateOfPrimary);

cout << NewPrimary <<endl;

delete="" []="" statename;=""
delete="" dateofprimary;=""

for="" (int="" i="0;" <="numberOfCandidates;" i++)=""
{=""
char="" nameandspent[50];="" char="" array="" for="" name="" and="" money="" spent=""
cin.getline(nameandspent,50);=""
if="" (i="" !="0)"
candidates="" newcandidate(nameandspent);=""
cout="" <<="" newcandidate="" endl;=""
}=""

results="" newresults;=""
int="" votes;=""
cin="">> votes;
accumulator = accumulator + votes;
NewResults.voteArray[i-1] = votes;
}

NewResults.totalNumberOfVotes = accumulator;
NewResults.percentage();

cout << NewResults << endl;
cin >> numberOfResponses;

for (int i = 0; i <= numberOfResponses; i++)
{
int c, i, v;
cin >> c;
cin >> i;
cin >> v;
election MyElection(c,i,v);
}

char blank[5];
cin.getline(blank,5);
cin.getline(blank,5);

}while(!cin.eof());

return 0;
}
[end code]
the INPUT is like this:

Iowa
January 19, 2004
6
Kerry 50000
Clark 20000
Dean 40000
Gephardt 20000
Lieberman 10000
Edwards 40000
1128
83
540
318
60
957
15
1 2 8
3 2 5
1 3 6
1 1 6
6 1 7
5 2 5
2 4 7
4 3 6
6 2 7
1 4 9
6 4 7
3 4 7
2 3 6
1 4 8
4 2 6

New Hampshire
January 27, 2004
5
Kerry 500000
Clark 200000
Dean 400000
Lieberman 100000
Edwards 50000
84229
27254
57788
18829
26416
25
1 2 8
3 2 7
1 3 6
1 1 7
3 1 7
5 1 7
2 4 6
5 3 6
4 1 4
1 4 9
3 4 8
1 2 7
2 1 7
3 2 8
4 2 6
5 2 8
2 2 6
3 3 7
1 2 8
2 3 7
3 2 7
4 4 6
5 4 7
2 2 6
3 3 6

ps....if i use just one set of data...my program works...but when i add another set of data....such as above (there are two) one for iowa and one for new hampshire...it keeps going on forever...help please
GeneralRe: infinite loop Pin
Michael P Butler15-Feb-04 1:43
Michael P Butler15-Feb-04 1:43 
GeneralRe: infinite loop Pin
Robert A. T. Káldy16-Feb-04 12:23
Robert A. T. Káldy16-Feb-04 12:23 
GeneralGraphic interface Pin
Anonymous14-Feb-04 10:30
Anonymous14-Feb-04 10:30 
GeneralRe: Graphic interface Pin
Antti Keskinen14-Feb-04 10:43
Antti Keskinen14-Feb-04 10:43 
GeneralRe: Graphic interface Pin
Andrew Walker14-Feb-04 20:17
Andrew Walker14-Feb-04 20:17 
GeneralBug!!! Pin
mebraun14-Feb-04 9:47
mebraun14-Feb-04 9:47 
GeneralRe: Bug!!! Pin
Shog914-Feb-04 10:29
sitebuilderShog914-Feb-04 10:29 
Generaladditional details Pin
mebraun14-Feb-04 12:58
mebraun14-Feb-04 12:58 
GeneralHTML text from VC++ app Pin
progman14-Feb-04 9:39
progman14-Feb-04 9:39 
GeneralRichedit redisplay problem Pin
Sara Burns14-Feb-04 9:12
Sara Burns14-Feb-04 9:12 
GeneralDisabling menu selection Pin
krugger14-Feb-04 9:00
krugger14-Feb-04 9:00 
GeneralRe: Disabling menu selection Pin
Michael P Butler15-Feb-04 1:48
Michael P Butler15-Feb-04 1:48 
GeneralDialog closes on Escape Pin
krugger14-Feb-04 8:58
krugger14-Feb-04 8:58 
GeneralRe: Dialog closes on Escape Pin
Michael Dunn14-Feb-04 9:23
sitebuilderMichael Dunn14-Feb-04 9:23 
GeneralRe: Dialog closes on Escape Pin
alex.barylski14-Feb-04 10:56
alex.barylski14-Feb-04 10:56 
GeneralProblem with MFC minimize box Pin
Dev57814-Feb-04 7:07
Dev57814-Feb-04 7:07 
GeneralRe: Problem with MFC minimize box Pin
Antti Keskinen14-Feb-04 7:49
Antti Keskinen14-Feb-04 7:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.