Click here to Skip to main content
15,922,894 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: I implemented a chat Program But I am not able to connect to the server properly Pin
dharani16-May-07 18:20
dharani16-May-07 18:20 
QuestionHow to make visible the inserted item in Tree control? Pin
swamy Narasimha16-May-07 0:21
swamy Narasimha16-May-07 0:21 
AnswerRe: How to make visible the inserted item in Tree control? Pin
GuyM16-May-07 0:59
GuyM16-May-07 0:59 
GeneralRe: How to make visible the inserted item in Tree control? Pin
swamy Narasimha16-May-07 1:23
swamy Narasimha16-May-07 1:23 
QuestionProblem reading a unicode text file Pin
balu chettri16-May-07 0:14
balu chettri16-May-07 0:14 
AnswerRe: Problem reading a unicode text file Pin
David Crow16-May-07 2:46
David Crow16-May-07 2:46 
AnswerRe: Thanks! Pin
balu chettri17-May-07 5:00
balu chettri17-May-07 5:00 
QuestionConfusing but interesting thing happens! Pin
balu chettri17-May-07 6:06
balu chettri17-May-07 6:06 
Unicode Text File c:\test.txt contents:
"Test" (without quotes).

wchar_t is defined as unsigned short as it should be.
typedef unsigned short wchar_t;

But wifstream which is defined as
typedef basic_ifstream<wchar_t, char_traits<wchar_t> > wifstream;
cannot read unicode file correctly.
#include <fstream>
using namespace std;
void main () {
wifstream is ("c:\\test.txt");
wchar_t c;
while ((c = is.get ()) != WEOF) {
wprintf (L"%c", c);
}
}
output was:
..T.e.s.t.

When I tried short instead of wchar_t all went ok;
#include <fstream>
using namespace std;
void main () {
typedef basic_ifstream<short, char_traits<short> > ifs;
ifs is ("c:\\test.txt");
wchar_t c;
while ((c = is.get ()) != WEOF) {
wprintf (L"%c", c);
}
}
output was:
Test

Should wchar_t be defined as short or this is a bug
in standard C++ library shipped with VC++ 6.0?

B2C
QuestionLooking for an alternative c++ express compiler Pin
spacegrass15-May-07 23:57
spacegrass15-May-07 23:57 
AnswerRe: Looking for an alternative c++ express compiler Pin
Cedric Moonen16-May-07 0:12
Cedric Moonen16-May-07 0:12 
AnswerRe: Looking for an alternative c++ express compiler Pin
CPallini16-May-07 0:14
mveCPallini16-May-07 0:14 
AnswerRe: Looking for an alternative c++ express compiler Pin
Christian Graus16-May-07 0:17
protectorChristian Graus16-May-07 0:17 
Questionsearch on start menu [modified] Pin
prathuraj15-May-07 23:49
prathuraj15-May-07 23:49 
AnswerRe: search on start menu Pin
Nelek16-May-07 1:32
protectorNelek16-May-07 1:32 
QuestionHow to add a character in the begin and end of the string? Pin
ashokbngr15-May-07 23:21
ashokbngr15-May-07 23:21 
AnswerRe: How to add a character in the begin and end of the string? Pin
toxcct15-May-07 23:27
toxcct15-May-07 23:27 
AnswerRe: How to add a character in the begin and end of the string? Pin
Nibu babu thomas16-May-07 1:36
Nibu babu thomas16-May-07 1:36 
AnswerRe: How to add a character in the begin and end of the string? Pin
krmed16-May-07 1:52
krmed16-May-07 1:52 
AnswerRe: How to add a character in the begin and end of the string? Pin
balu chettri17-May-07 6:17
balu chettri17-May-07 6:17 
QuestionBarcode scanning using TWAIN Pin
kk.tvm15-May-07 22:13
kk.tvm15-May-07 22:13 
Questioninterface and main in VC++2005 Pin
lavy288315-May-07 22:05
lavy288315-May-07 22:05 
AnswerRe: interface and main in VC++2005 Pin
Hamid_RT15-May-07 22:11
Hamid_RT15-May-07 22:11 
AnswerRe: interface and main in VC++2005 Pin
Cedric Moonen15-May-07 22:15
Cedric Moonen15-May-07 22:15 
GeneralRe: interface and main in VC++2005 Pin
lavy288315-May-07 22:19
lavy288315-May-07 22:19 
Questionhow to display html Pin
john563215-May-07 20:53
john563215-May-07 20:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.