PAGE2GO2 HOME | INTERNET NEWS

LeighExchange - Free Advertising Network Stock Research at Internet Speed Need Money Easy and Quick?

main(int argc, wchar_t *argv[]) on linux i386 (redhat)

 List
Subject: main(int argc, wchar_t *argv[]) on linux i386 (redhat)
Poster: interec@interec.net
Date: 23 Mar 2007 14:54:52 -0700
Related Postings: 1
Hi Folks,

I am writing a c++ program on redhat linux using main(int argc, wchar_t *argv[]). $LANG on console is set to "en_US.UTF-8". g++ compiler version is 3.4.6.

Q1. what is the encoding of data that I get in argv[] ?

Q2. what is encoding of string constants defined in programs (for example L"--count") ?

Q3. when I run the program as:

./a.out --count 1

Why does (wcscmp(argv[1], L"--count") == 0) always evaluate to false? What is the workaround. How do I make it evaluate to true?

Q4: when I do wstring

mystring = argv[1];

is mystring considered to be a UTF-8 string?

Q5: In case I use main(int argc, char** argv),

what is the encoding of characters in argv[] ?

Q6. What is the difference between main(int arc, wchar_t *argv[]) and main(int argc, char *argv[]). Any document that describes this? My compiler is gcc 3.4.6

Thanks

 

Page2Go2.com is not responsible for content of this message.