Click here to Skip to main content
15,921,884 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to solve unresolved external symbol error in NggolekiGinambaran... Pin
Michael Schubert23-Apr-09 5:17
Michael Schubert23-Apr-09 5:17 
General[Message Deleted] Pin
tasmin iqbal22-Apr-09 23:25
tasmin iqbal22-Apr-09 23:25 
GeneralRe: how to solve unresolved external Symbols error in NggolekiGinambaran. Pin
Cedric Moonen22-Apr-09 23:34
Cedric Moonen22-Apr-09 23:34 
GeneralRe: how to solve unresolved external Symbols error in NggolekiGinambaran. Pin
tasmin iqbal22-Apr-09 23:35
tasmin iqbal22-Apr-09 23:35 
QuestionDirectShow Blues Pin
Teashirt222-Apr-09 21:14
Teashirt222-Apr-09 21:14 
AnswerRe: DirectShow Blues Pin
Rajkumar R23-Apr-09 2:38
Rajkumar R23-Apr-09 2:38 
GeneralRe: DirectShow Blues Pin
Teashirt223-Apr-09 3:29
Teashirt223-Apr-09 3:29 
QuestionTrouble with loops Pin
StateofMind0922-Apr-09 20:22
StateofMind0922-Apr-09 20:22 
I've got an assignment that I've been struggling with all day, and after re-doing the program several times I believe I've narrowed down my problem to this:

#include <stdio.h>
#include <stdlib.h>

int random;
int guess;
char play = 'y';
int game = 1;

int main()
{
	while(game == 1)
	{
	if(play == 'y')
	{
		random = 1 + rand() %  1000;

		printf("\nI have a number between 1 and 1000.\nCan you guess my number?\nType your first guess:");

		play = 'v';

	}
		scanf("%i",&guess);

		if(guess == random)
		{
			printf("\nExcellent! You guessed the number!\nWould you like to play again?(y/n)");
			scanf("%c",&play);
			if(play == 'n')
			{
				 game = 0;
			}
		}

		else
		{
			if(guess < random && guess != random)
			{
				printf("\nToo low, try again!");
			}

			if(guess > random && guess != random)
			{
				printf("\nToo high, try again!");
			}
		}
	}

		return 0;
}

</stdlib.h></stdio.h>


When I enter the if(guess == random){} block and answer the (y/n) question, the program falls apart. No matter what I seem to do, it'll shut down, stop functioning, or repeat that block once more before it moves on to what it's supposed to do. I don't understand what I'm doing wrong.
AnswerRe: Trouble with loops Pin
ShiXiangYang22-Apr-09 20:46
ShiXiangYang22-Apr-09 20:46 
QuestionRe: Trouble with loops [modified] Pin
CPallini22-Apr-09 21:57
mveCPallini22-Apr-09 21:57 
AnswerRe: Trouble with loops Pin
Stuart Dootson22-Apr-09 22:28
professionalStuart Dootson22-Apr-09 22:28 
QuestionPlay mov file using directshow Pin
raj157622-Apr-09 19:53
raj157622-Apr-09 19:53 
QuestionHow to display .jp2 and .jpg images in my dialog box? Pin
kapardhi22-Apr-09 19:43
kapardhi22-Apr-09 19:43 
AnswerRe: How to display .jp2 and .jpg images in my dialog box? Pin
Jijo.Raj22-Apr-09 20:05
Jijo.Raj22-Apr-09 20:05 
GeneralRe: How to display .jp2 and .jpg images in my dialog box? Pin
kapardhi23-Apr-09 0:37
kapardhi23-Apr-09 0:37 
AnswerRe: How to display .jp2 and .jpg images in my dialog box? Pin
ShiXiangYang22-Apr-09 20:54
ShiXiangYang22-Apr-09 20:54 
GeneralRe: How to display .jp2 and .jpg images in my dialog box? Pin
kapardhi23-Apr-09 0:55
kapardhi23-Apr-09 0:55 
QuestionHow to Convert String Array to LPWSTR* Pin
ANURAG VISHNOI22-Apr-09 18:42
ANURAG VISHNOI22-Apr-09 18:42 
AnswerRe: How to Convert String Array to LPWSTR* Pin
Cedric Moonen22-Apr-09 20:08
Cedric Moonen22-Apr-09 20:08 
AnswerRe: How to Convert String Array to LPWSTR* Pin
ANURAG VISHNOI22-Apr-09 20:26
ANURAG VISHNOI22-Apr-09 20:26 
GeneralRe: How to Convert String Array to LPWSTR* Pin
Cedric Moonen22-Apr-09 21:05
Cedric Moonen22-Apr-09 21:05 
AnswerRe: How to Convert String Array to LPWSTR* Pin
Stuart Dootson22-Apr-09 22:04
professionalStuart Dootson22-Apr-09 22:04 
Questioncode required for programming the encoder and decoder of PCM module. Pin
NamraHayee22-Apr-09 18:01
NamraHayee22-Apr-09 18:01 
AnswerRe: code required for programming the encoder and decoder of PCM module. Pin
CPallini22-Apr-09 22:01
mveCPallini22-Apr-09 22:01 
GeneralRe: code required for programming the encoder and decoder of PCM module. Pin
NamraHayee24-Apr-09 18:44
NamraHayee24-Apr-09 18:44 

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.