By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,421 Members | 1,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,421 IT Pros & Developers. It's quick & easy.

what's wrong with this programe

P: n/a
#include<iostream>
#include<fstream>
using namespace std;
void main()
{
wchar_t str='hh';
wcout<<str;
}

Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Michael" <wi****@sina.com> skrev i en meddelelse
news:bp**********@news.yaako.com...
#include<iostream>
#include<fstream>
using namespace std;
void main() int main() {
wchar_t str='hh'; wchar_t str=L"hh"; wcout<<str;
}


Peter
Jul 22 '05 #2

P: n/a
Michael wrote:
#include<iostream>
#include<fstream>
using namespace std;
This need not be a good idea
void main()
This is wrong
{
wchar_t str='hh';
You probably want

wchar_t *string = L"hh";

or maybe

wchar_t character = L'h';

If you call it "str", you probably want the first of these two,
but who knows.
wcout<<str;
}


Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.