really could give you any value, because you are using the strlen incorrectly with newstr...
2010/1/11 CK <boz...@gmail.com> > > > I'm trying to define dynamic array using "new". > > Char *str = "Hello World"; > Char *newstr = new char[strlen(str)]; > > Cout<<strlen(str)<<endl; > Cout<<strlen(newstr)<<endl; > > Strlen(str) = 11; > Strlen(newstr) = 3; > > Why is it only 3? What is wrong? Can somebody help me with this? > > Thank you > > CK > > [Non-text portions of this message have been removed] > > > -- -------------------------------------------------------- VISIT MY BLOG : http://ageo.blogspot.com/ picture blog : http://ageo.deviantart.com/journal/ [Non-text portions of this message have been removed] ------------------------------------ To unsubscribe, send a blank message to <mailto:c-prog-unsubscr...@yahoogroups.com>.Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/c-prog/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/c-prog/join (Yahoo! ID required) <*> To change settings via email: c-prog-dig...@yahoogroups.com c-prog-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: c-prog-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/