|
-
May 5th, 2003, 08:06 PM
#1
cout.put(65) error. why?
VC consloe
cout.put(65)//65 is the ASCII code of 'A'
error C2668: 'put' : ambiguous call to overloaded function
why?
-
May 5th, 2003, 08:12 PM
#2
Are you using
Code:
#include <iostream.h>
if so, that is non-standard ... use the standard
Code:
#include <iostream>
-
May 5th, 2003, 08:39 PM
#3
Originally posted by Philip Nicoletti
Are you using
Code:
#include <iostream.h>
if so, that is non-standard ... use the standard
Code:
#include <iostream>
thanks much! but when i use
#include <iostream>
cout became an undeclared identifier!
error C2065: 'cout' : undeclared identifier
-
May 5th, 2003, 08:53 PM
#4
the stream functions reside in namespace std,
so you need something like this:
Code:
#include <iostream>
using namespace std; // add this line
int main()
{
cout.put(65);
return 0;
}
or you can qualify cout as follows :
Code:
#include <iostream>
int main()
{
std::cout.put(65);
return 0;
}
If you do a search on Andreas Masur posts, he has a
good exaplanation on namespaces
-
May 5th, 2003, 08:56 PM
#5
-
May 5th, 2003, 09:04 PM
#6
you are really kind
thanks again! you have help me resolve the problem throughly
btw:
West Virginia an beautiful place I have known from
<take me home country roads > of John denver
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|