Click here to Skip to main content
15,914,162 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Enumerating Files in a Folder Pin
Saurabh.Garg30-Sep-08 14:33
Saurabh.Garg30-Sep-08 14:33 
GeneralRe: Enumerating Files in a Folder Pin
Bram van Kampen30-Sep-08 15:04
Bram van Kampen30-Sep-08 15:04 
GeneralRe: Enumerating Files in a Folder Pin
Saurabh.Garg1-Oct-08 20:10
Saurabh.Garg1-Oct-08 20:10 
QuestionParent Forms Pin
Sarriss30-Sep-08 6:05
Sarriss30-Sep-08 6:05 
QuestionRe: Parent Forms Pin
Mark Salsbery30-Sep-08 6:25
Mark Salsbery30-Sep-08 6:25 
AnswerRe: Parent Forms Pin
Sarriss30-Sep-08 7:37
Sarriss30-Sep-08 7:37 
GeneralRe: Parent Forms Pin
Mark Salsbery30-Sep-08 8:31
Mark Salsbery30-Sep-08 8:31 
GeneralRe: Parent Forms Pin
Sarriss30-Sep-08 9:26
Sarriss30-Sep-08 9:26 
AnswerRe: Parent Forms Pin
led mike30-Sep-08 7:57
led mike30-Sep-08 7:57 
GeneralRe: Parent Forms Pin
Sarriss30-Sep-08 8:04
Sarriss30-Sep-08 8:04 
QuestionRe: Parent Forms Pin
Mark Salsbery30-Sep-08 8:32
Mark Salsbery30-Sep-08 8:32 
AnswerRe: Parent Forms Pin
Sarriss30-Sep-08 9:24
Sarriss30-Sep-08 9:24 
GeneralRe: Parent Forms Pin
Mark Salsbery30-Sep-08 9:30
Mark Salsbery30-Sep-08 9:30 
GeneralRe: Parent Forms Pin
Sarriss30-Sep-08 9:33
Sarriss30-Sep-08 9:33 
GeneralRe: Parent Forms Pin
Mark Salsbery30-Sep-08 9:58
Mark Salsbery30-Sep-08 9:58 
GeneralRe: Parent Forms Pin
Sarriss30-Sep-08 10:31
Sarriss30-Sep-08 10:31 
GeneralRe: Parent Forms Pin
Hamid_RT30-Sep-08 10:50
Hamid_RT30-Sep-08 10:50 
GeneralRe: Parent Forms Pin
Sarriss30-Sep-08 11:04
Sarriss30-Sep-08 11:04 
QuestionTracking application memory usage Pin
JoeSchmoe00730-Sep-08 5:25
JoeSchmoe00730-Sep-08 5:25 
AnswerRe: Tracking application memory usage Pin
Rick York30-Sep-08 6:17
mveRick York30-Sep-08 6:17 
GeneralRe: Tracking application memory usage Pin
JoeSchmoe00730-Sep-08 6:59
JoeSchmoe00730-Sep-08 6:59 
AnswerRe: Tracking application memory usage Pin
David Crow30-Sep-08 10:19
David Crow30-Sep-08 10:19 
AnswerRe: Tracking application memory usage Pin
Naveen30-Sep-08 14:03
Naveen30-Sep-08 14:03 
QuestionAccepting a drag/drop from a camera drive Pin
Felix_H30-Sep-08 5:22
Felix_H30-Sep-08 5:22 
Questionfor... loop to while loop Pin
Mghand30-Sep-08 5:02
Mghand30-Sep-08 5:02 
Hey all, first year CS 1 student here and i am having some problems with my latest project
purpose of project: create 100 random numbers and display them in txtLog
i'm trying to change this for loop to a while... loop:
private: System::Void btnCreate_Click(System::Object^  sender, System::EventArgs^  e) {
int items;
double thick;
Int32::TryParse(txtItems->Text, items);
for (int i = 0; i<items;>{
thick = randomNumGen->Next(0,1000)/100.00;
strLog += "Chump  " + i + ":\t" + thick + " mm\r\n";
}
txtLog->Text = strLog;


what i've come up with is this:

private: System::Void btnCreate_Click(System::Object^  sender, System::EventArgs^  e) {
double thick;

int i = 0;
int items = 0;
while (items > 1000);
{
thick = randomNumGen->Next(0,1000)/100.00;
strLog += "Chump  " + i + ":\t" + thick + " mm\r\n";
}
txtLog->Text = strLog;

It seems to work, i get no errors, but when running and clicking btnCreate, it only lists 1 random number "Chump 0 - random number" instead of 100 random numbers in txtLog "Chump 0 - random number, chump 1, chump 2, up to 99 etc". I think that i went completely wrong when i changed it, do i need to assign i = 0 or items = 0 etc. ?

Sorry if i did this wrong! i've only been programming for a month now!

if you need more info just ask!

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.