Click here to Skip to main content
15,902,938 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
Generalarray size of 4294967296 Pin
lyn19-Feb-04 19:36
lyn19-Feb-04 19:36 
GeneralRe: array size of 4294967296 Pin
Russell Morris1-Mar-04 11:46
Russell Morris1-Mar-04 11:46 
GeneralHelp please, with TextOut fonts Pin
GrahamRounce17-Feb-04 2:02
GrahamRounce17-Feb-04 2:02 
Generalconversion form String type to int type Pin
adarsh_sebiz16-Feb-04 21:23
adarsh_sebiz16-Feb-04 21:23 
GeneralRe: conversion form String type to int type Pin
bollwerj19-Feb-04 3:26
bollwerj19-Feb-04 3:26 
Generalerror MIDL2025: syntax error, please help! Pin
adarsh_sebiz16-Feb-04 19:39
adarsh_sebiz16-Feb-04 19:39 
GeneralMCppCodeDomParser Error...cant graphically edit form Pin
FocusedWolf15-Feb-04 16:18
FocusedWolf15-Feb-04 16:18 
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
leppie14-Feb-04 20:06
leppie14-Feb-04 20:06 
QuestionHow can I read a number from a text file? Pin
chinaskf14-Feb-04 4:01
chinaskf14-Feb-04 4:01 
GeneralXML SAX in C++ Pin
adarsh_sebiz13-Feb-04 18:01
adarsh_sebiz13-Feb-04 18:01 
GeneralRe: XML SAX in C++ Pin
Ravi Bhavnani13-Feb-04 18:06
professionalRavi Bhavnani13-Feb-04 18:06 
Generalhelp me Pin
don7cry13-Feb-04 16:59
don7cry13-Feb-04 16:59 
QuestionAnyway to make code auto-format like it does in c#, and a few other c# formatting things? Pin
FocusedWolf13-Feb-04 16:19
FocusedWolf13-Feb-04 16:19 
GeneralReading/Writing file probs Pin
Tank_Aviator11-Feb-04 8:45
Tank_Aviator11-Feb-04 8:45 
GeneralRe: Reading/Writing file probs Pin
dj_oden14-Feb-04 1:05
dj_oden14-Feb-04 1:05 
GeneralRe: Reading/Writing file probs Pin
Nik Vogiatzis18-Feb-04 16:52
Nik Vogiatzis18-Feb-04 16:52 
GeneralRe: Reading/Writing file probs Pin
Nik Vogiatzis19-Feb-04 12:44
Nik Vogiatzis19-Feb-04 12:44 
GeneralCalling Convention Trouble Pin
Pazzuzu10-Feb-04 23:54
Pazzuzu10-Feb-04 23:54 
GeneralCalling Dll's Pin
Pazzuzu10-Feb-04 3:46
Pazzuzu10-Feb-04 3:46 
GeneralSTRING* to LPTSTR Pin
bollwerj9-Feb-04 10:29
bollwerj9-Feb-04 10:29 
GeneralRe: STRING* to LPTSTR Pin
Dirk Moshage12-Feb-04 23:21
Dirk Moshage12-Feb-04 23:21 
GeneralRe: STRING* to LPTSTR Pin
bollwerj13-Feb-04 3:27
bollwerj13-Feb-04 3:27 
GeneralRe: STRING* to LPTSTR Pin
Nik Vogiatzis18-Feb-04 16:57
Nik Vogiatzis18-Feb-04 16:57 
GeneralRe: STRING* to LPTSTR Pin
bollwerj19-Feb-04 3:18
bollwerj19-Feb-04 3:18 

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.