Re: c++ "cout" causing problems

  • From: "tribble" <lauraeaves@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Sat, 16 Feb 2008 19:04:26 -0500

the word "int" is a keyword in C++ -- this should fail miserably and the 
compiler should rightly give you a cascade of errors.
And you can't declare something inside a cout operation.
If you want to use "int i;" to declare an integer i and then output the 
value of i, do this:
    int i = 0;
        cout << i;
HTH
--le

----- Original Message ----- 
From: "Alex Hall" <mehgcap@xxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Saturday, February 16, 2008 3:49 PM
Subject: c++ "cout" causing problems


Hi all,
I have not done c++ in a year or so, but even so this should work
fine:
cout << int+":"+int+":"+int;
It causes the program to not compile, though; when I comment it
out it works fine, but when I leave it says something about the +
operator (I cannot review my errors very easily in the ide I
have).  What is going on? The statement should not have any
problems.  Oh, "int" are 3 variable names, h, m, and s.  Thanks
for any help.

Have a great day,
Alex
__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: