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

C / C++ / MFC

 
GeneralRe: OOP problem with MFC Pin
palbano10-Jun-04 9:23
palbano10-Jun-04 9:23 
GeneralRe: OOP problem with MFC Pin
Anonymous10-Jun-04 10:50
Anonymous10-Jun-04 10:50 
QuestionHow to draw a graphical object independently? Pin
Arun AC10-Jun-04 8:09
Arun AC10-Jun-04 8:09 
AnswerRe: How to draw a graphical object independently? Pin
Johan Rosengren10-Jun-04 8:40
Johan Rosengren10-Jun-04 8:40 
Generalstruct _timeb Question Pin
Nick Parker10-Jun-04 7:25
protectorNick Parker10-Jun-04 7:25 
GeneralRe: struct _timeb Question Pin
Michael Dunn10-Jun-04 8:15
sitebuilderMichael Dunn10-Jun-04 8:15 
GeneralRe: struct _timeb Question Pin
Nick Parker10-Jun-04 8:30
protectorNick Parker10-Jun-04 8:30 
GeneralC++ Random Question Pin
bobski220010-Jun-04 6:21
bobski220010-Jun-04 6:21 
Smile | :) First off apols if this is in the wrong section i am new here

I have this code now and try as i may i cannot get the random number to change it is always 41 when it should be between 0-100. I am not that good at C++ and would appreciate any help can i please reinforce the basis that my knowledge is very basic thanks for any help guys.


#include <iostream.h>
#include <stdlib.h>

int main(void)
{
// declare our variables
// Guess entered by user and random number
int guess, random;

random = rand();

// Creates a loop for the main program
do
{
cout << "My High-Low game!\n\n";
cout << "Please enter a number between 0 and 100: ";

cin >> guess;

cout << "You entered " << guess << "!\n";

if (guess == random)
{
cout << "Correct guess, the answer is " << guess << "!\n";
}
else
{
if (guess > random)
{
cout << "Your guess is too high!\n";
}
else
{
cout << "Your guess is too low!\n";
}
}

// Terminating condition for the loop
// Program stops when the guess equals the random number
}
while(guess!=random);

// This command pauses the program
system("PAUSE");
return 0;
}

This Better ******* Work!
GeneralRe: C++ Random Question Pin
jmkhael10-Jun-04 6:25
jmkhael10-Jun-04 6:25 
GeneralRe: C++ Random Question Pin
Graham Bradshaw10-Jun-04 6:27
Graham Bradshaw10-Jun-04 6:27 
GeneralRe: C++ Random Question Pin
Rick York10-Jun-04 6:32
mveRick York10-Jun-04 6:32 
GeneralRe: C++ Random Question Pin
Cohen10-Jun-04 6:44
Cohen10-Jun-04 6:44 
GeneralRe: C++ Random Question Pin
bobski220010-Jun-04 6:47
bobski220010-Jun-04 6:47 
GeneralRe: C++ Random Question Pin
David Crow10-Jun-04 9:08
David Crow10-Jun-04 9:08 
GeneralRe: C++ Random Question Pin
Cohen10-Jun-04 6:50
Cohen10-Jun-04 6:50 
GeneralProblems overloading htons, htonl, ntohl, &amp; ntohs Pin
Wheatbread10-Jun-04 5:47
Wheatbread10-Jun-04 5:47 
GeneralRe: Problems overloading htons, htonl, ntohl, & ntohs Pin
jmkhael10-Jun-04 5:50
jmkhael10-Jun-04 5:50 
GeneralRe: Problems overloading htons, htonl, ntohl, &amp; ntohs Pin
Wheatbread10-Jun-04 6:21
Wheatbread10-Jun-04 6:21 
GeneralRe: Problems overloading htons, htonl, ntohl, &amp; ntohs Pin
jmkhael10-Jun-04 6:23
jmkhael10-Jun-04 6:23 
GeneralRe: Problems overloading htons, htonl, ntohl, &amp; ntohs Pin
Wheatbread10-Jun-04 6:32
Wheatbread10-Jun-04 6:32 
GeneralRe: Problems overloading htons, htonl, ntohl, &amp; ntohs Pin
jmkhael10-Jun-04 6:37
jmkhael10-Jun-04 6:37 
GeneralRe: Problems overloading htons, htonl, ntohl, &amp; ntohs Pin
Wheatbread10-Jun-04 6:46
Wheatbread10-Jun-04 6:46 
GeneralStandalone MFC program Pin
hdaly10-Jun-04 5:17
hdaly10-Jun-04 5:17 
GeneralRe: Standalone MFC program Pin
Navin10-Jun-04 5:23
Navin10-Jun-04 5:23 
Generaltroubles with templates Pin
Kamis10-Jun-04 5:04
Kamis10-Jun-04 5:04 

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.