Unnecessary characters

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jul 2008
Posts: 46
Reputation: karang is an unknown quantity at this point 
Solved Threads: 0
karang karang is offline Offline
Light Poster

Unnecessary characters

 
0
  #1
Dec 17th, 2008
Hi

I am using the code to get the current date
CTime aNow = CTime::GetCurrentTime();
char month[3];
char day[3];
char year[6];
char todaysdate[30];

itoa(aNow.GetMonth(), month, 10);
itoa(aNow.GetYear(), year, 10);
itoa(aNow.GetDay(), day, 10);

strcat(todaysdate,month);

I am getting value of month but apart from that I am also getting an unexpected character "He"

so My final output is

He 12

Why this extra He is coming.

Kindly advice

Regards
Karan
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 320
Reputation: cikara21 is an unknown quantity at this point 
Solved Threads: 63
cikara21's Avatar
cikara21 cikara21 is offline Offline
Posting Whiz

Re: Unnecessary characters

 
0
  #2
Dec 17th, 2008
try this...
char month[3] = {NULL};
etc..
.:-cikara21-:.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC