Click here to Skip to main content
15,905,563 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalarray of Strings Pin
convert_sg29-Oct-03 15:14
convert_sg29-Oct-03 15:14 
GeneralRe: array of Strings Pin
Navin29-Oct-03 15:30
Navin29-Oct-03 15:30 
GeneralRe: array of Strings Pin
convert_sg29-Oct-03 15:48
convert_sg29-Oct-03 15:48 
GeneralRe: array of Strings Pin
vcplusplus29-Oct-03 15:39
vcplusplus29-Oct-03 15:39 
GeneralRe: array of Strings Pin
Christian Graus29-Oct-03 15:48
protectorChristian Graus29-Oct-03 15:48 
GeneralChange font size for CComboBox and CEdit Pin
srev29-Oct-03 14:14
srev29-Oct-03 14:14 
GeneralRe: Change font size for CComboBox and CEdit Pin
Yonatan26-Nov-03 2:04
Yonatan26-Nov-03 2:04 
Generalsimple console input question Pin
rajdawg29-Oct-03 14:09
rajdawg29-Oct-03 14:09 
Given these requirements for a console application:
Enter a series of integers seperated by whitespace. The first integer represents the quantity of integers to follow.
Ex. 3 5 18 21
or. 5 17 -46 3 198 2

I have been attempting the following to read the integers and store them in a vector:
scanf("%d", &cnt);
for(int i = 1; i <= cnt + 1; i++)
{
scanf("%d", &n);
aInts.push_back(n);
}

This works fine, unless someone enters fewer integers than the initial integer indicates. (ex. 3 19 5)
How can I test to see if the end of the input stream has been reached?

I have attempted the same type of logic using cin, to no avail.

Thank you in advance for your help.
GeneralRe: simple console input question Pin
Christian Graus29-Oct-03 15:23
protectorChristian Graus29-Oct-03 15:23 
GeneralRe: simple console input question Pin
Christian Graus29-Oct-03 15:47
protectorChristian Graus29-Oct-03 15:47 
GeneralRe: simple console input question Pin
rajdawg30-Oct-03 1:08
rajdawg30-Oct-03 1:08 
GeneralLayered Service Provider (LSP) Pin
catmust29-Oct-03 13:55
catmust29-Oct-03 13:55 
GeneralRe: Layered Service Provider (LSP) Pin
Alexander M.,30-Oct-03 2:49
Alexander M.,30-Oct-03 2:49 
GeneralRe: Layered Service Provider (LSP) Pin
catmust30-Oct-03 8:55
catmust30-Oct-03 8:55 
GeneralLoading dll issue during debuging Pin
catmust29-Oct-03 13:48
catmust29-Oct-03 13:48 
Generalmemory allocation issues Pin
Steven M Hunt29-Oct-03 13:21
Steven M Hunt29-Oct-03 13:21 
GeneralRe: memory allocation issues Pin
Christian Graus29-Oct-03 15:52
protectorChristian Graus29-Oct-03 15:52 
Generalsockets and threads Pin
michael_cowan29-Oct-03 13:14
michael_cowan29-Oct-03 13:14 
GeneralWINS Pin
Jair29-Oct-03 13:06
Jair29-Oct-03 13:06 
GeneralRe: WINS Pin
Jair1-Nov-03 3:29
Jair1-Nov-03 3:29 
QuestionXP GetSysColor()??? Pin
alex.barylski29-Oct-03 12:17
alex.barylski29-Oct-03 12:17 
AnswerRe: XP GetSysColor()??? Pin
michael_cowan29-Oct-03 13:00
michael_cowan29-Oct-03 13:00 
GeneralRe: XP GetSysColor()??? Pin
alex.barylski29-Oct-03 15:17
alex.barylski29-Oct-03 15:17 
GeneralCalling a dialog from a dll question Pin
Steve Messer29-Oct-03 11:53
Steve Messer29-Oct-03 11:53 
GeneralRe: Calling a dialog from a dll question Pin
igor196029-Oct-03 12:49
igor196029-Oct-03 12: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.