Click here to Skip to main content
15,923,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ question Pin
Marc Clifton11-Sep-05 13:48
mvaMarc Clifton11-Sep-05 13:48 
GeneralRe: C++ question Pin
PJ Arends11-Sep-05 19:28
professionalPJ Arends11-Sep-05 19:28 
GeneralRe: C++ question Pin
Christian Graus11-Sep-05 12:46
protectorChristian Graus11-Sep-05 12:46 
GeneralRe: C++ question Pin
Marc Clifton11-Sep-05 13:49
mvaMarc Clifton11-Sep-05 13:49 
GeneralRe: C++ question Pin
Christian Graus11-Sep-05 13:53
protectorChristian Graus11-Sep-05 13:53 
GeneralRe: C++ question Pin
Nemanja Trifunovic12-Sep-05 2:26
Nemanja Trifunovic12-Sep-05 2:26 
GeneralRe: C++ question Pin
Nemanja Trifunovic12-Sep-05 2:30
Nemanja Trifunovic12-Sep-05 2:30 
GeneralC++ question Pin
Sveta8011-Sep-05 7:32
Sveta8011-Sep-05 7:32 
Hi guys!
I see that most of people here are very smart programmer so my question may seem like a silly one but keep in mind that I am just started to learn C++.
I am writing a sorting program using dynamically allocated array. I know how to write a program when the size of the array is known. Well, this time I don't know the size of it. My program suppose to read the positive numbers from the keyboard and it need to quit only when i hit ^C. How do you declare your array and populate it when you don't know the size?!
I know that I should use something like this:
int *pointer;
int size;
pointer = new int [size];
but when I go to my for loop what do I say my size should be?
Any help would be greatly appriciated!!!!

Sveta

-- modified at 14:36 Sunday 11th September, 2005
GeneralRe: C++ question Pin
Trollslayer11-Sep-05 7:42
mentorTrollslayer11-Sep-05 7:42 
GeneralRe: C++ question Pin
El Corazon11-Sep-05 7:55
El Corazon11-Sep-05 7:55 
GeneralRe: C++ question Pin
Trollslayer11-Sep-05 13:53
mentorTrollslayer11-Sep-05 13:53 
GeneralRe: C++ question Pin
Blake Miller12-Sep-05 4:38
Blake Miller12-Sep-05 4:38 
GeneralRe: C++ question Pin
Marc Clifton11-Sep-05 8:03
mvaMarc Clifton11-Sep-05 8:03 
GeneralRe: C++ question Pin
DavidNohejl11-Sep-05 8:09
DavidNohejl11-Sep-05 8:09 
GeneralRe: C++ question Pin
Marc Clifton11-Sep-05 8:12
mvaMarc Clifton11-Sep-05 8:12 
GeneralRe: C++ question Pin
DavidNohejl11-Sep-05 8:15
DavidNohejl11-Sep-05 8:15 
GeneralRe: C++ question Pin
Marc Clifton11-Sep-05 8:06
mvaMarc Clifton11-Sep-05 8:06 
GeneralRe: C++ question Pin
nde_plume11-Sep-05 11:42
nde_plume11-Sep-05 11:42 
GeneralRe: C++ question Pin
Marc Clifton11-Sep-05 12:02
mvaMarc Clifton11-Sep-05 12:02 
GeneralRe: C++ question Pin
nde_plume11-Sep-05 14:15
nde_plume11-Sep-05 14:15 
GeneralRe: C++ question Pin
Marc Clifton11-Sep-05 15:30
mvaMarc Clifton11-Sep-05 15:30 
GeneralRe: C++ question Pin
Jim Crafton11-Sep-05 8:43
Jim Crafton11-Sep-05 8:43 
GeneralRe: C++ question Pin
Christian Graus11-Sep-05 12:45
protectorChristian Graus11-Sep-05 12:45 
GeneralRe: C++ question Pin
David Crow12-Sep-05 4:20
David Crow12-Sep-05 4:20 
GeneralRe: C++ question Pin
Anonymous12-Sep-05 5:37
Anonymous12-Sep-05 5:37 

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.