| | |
Coverting varibles
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2004
Posts: 108
Reputation:
Solved Threads: 3
atoi for converting a char * to an int C or Or stringstreams for C++
Join me on IRC:
Server: irc.daniweb.com
Channel: #C++
Chat Via:
http://daniweb.com/chat/minichat.php
or
Your favorite IRC client.
Server: irc.daniweb.com
Channel: #C++
Chat Via:
http://daniweb.com/chat/minichat.php
or
Your favorite IRC client.
for CString (I assume you mean Microsoft MFC CString class)
C++ Syntax (Toggle Plain Text)
// convert from CString to int just requires typcasting the CString CString str = "123"; int n = atoi((LPCTSTR)str); // convert from int to CString str.Format("%d", n);
ok so would the following statement work then?
and yes I meant MFC CStrings... Sorry I didn't mentionthat
C++ Syntax (Toggle Plain Text)
char *str[5]; str[0] = "123"; int n = atoi((LPCTSTR)str[0]);
•
•
•
•
Originally Posted by atrusmre
ok so would the following statement work then?
C++ Syntax (Toggle Plain Text)
char *str[5]; str[0] = "123"; int n = atoi((LPCTSTR)str[0]);
C++ Syntax (Toggle Plain Text)
char *str[5]; str[0] = "123"; int n = atoi(str[0]);
![]() |
Similar Threads
Other Threads in the C++ Forum
- Previous Thread: Cbuilder Fullscreen form how to ???
- Next Thread: Store large numbers in C
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






