delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/07/21/03:37:02

From: marshall AT cwb DOT matrix DOT com DOT br (Marcel R.)
Subject: Problem with my code...
21 Jul 1998 03:37:02 -0700 :
Message-ID: <3.0.3.32.19980720104428.0068afa4.cygnus.gnu-win32@pop.cwb.matrix.com.br>
References: <3 DOT 0 DOT 5 DOT 32 DOT 19980716151304 DOT 00988360 AT pop DOT ma DOT ultranet DOT com>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

Hi everybody..
This is the start of my code:

#include <iostream.h>
int main ()
{
int number;
char adjcoffee;
char adjdog;
char adjcat;
char adjmouse;
char adjocean;
cout << "\nChoose a number between 1 and 100:";
cin >> number;
cout << "\nGive an adjective for dog:";
cin >> adjdog;

Well, first i tried to declarate all the char, separated with "," but the
compiler warned about undeclared variables. Then, i do this way. The
problem is: When i put an adjective for dog, it jump a piece of my code.
Like this:
Choose a number between 1 and 100: 3
Give an adjective for dog: Ugly
-> this line stay empty
cat: -> dont ask for the adjective
Mouse: -> The same
Coffee: -> Hidden
Ocean: -> Ask normally

But if i put numbers, it works normally, like if i had declared a int.

What i am doing wrong???
Thanks... Oh, and one comment... Java is much easier than this...:)))



-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Home Page: http://i.am/marshall/
e-mail: marshall AT cwb DOT matrix DOT com DOT br ou marshall AT i DOT am

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019