| | |
int * Help
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
First you have to find out how many comma-separated words are in the string. Iterate through the string and count the commans. Then allocate the int array large enough to hold that many integers. After that, go through the string agsin, this time when you find a comma set one of the integers to be the numeric value of where the comma was found.
For example in the string you posted you will need three integers because the string contains three comma-separated words. The first integer will be 0, the second integer 4 and the 3d integer is 9.
For example in the string you posted you will need three integers because the string contains three comma-separated words. The first integer will be 0, the second integer 4 and the 3d integer is 9.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Huh? I assume DMA means Direct Memory Address. How does that relate to the discussion of this thread ? BTW DMA is not possible with any 32-bit compiler unless writing a kernel-mode device driver.
Last edited by Ancient Dragon; Dec 18th, 2007 at 10:09 am.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
I think he means 'Dynamic Memory Allocation' - I could be wrong though. Either way, it works fine with both char and int
Last edited by Bench; Dec 18th, 2007 at 11:20 am.
¿umop apisdn upside down? ![]() |
Similar Threads
- convert int to string (C)
- turning and int into seperate digits (C++)
- variable function parameters functionname(int a, ...) (C)
Other Threads in the C++ Forum
- Previous Thread: Program help
- Next Thread: No output
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays assignment based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator getline givemetehcodez graph iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets




.

