Click here to Skip to main content
15,890,982 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: On File-> New (Project) Win32 application and MFC wizard Pin
kailai_nishanth16-Aug-04 20:51
kailai_nishanth16-Aug-04 20:51 
GeneralRe: On File-> New (Project) Win32 application and MFC wizard Pin
David Crow17-Aug-04 5:32
David Crow17-Aug-04 5:32 
GeneralRe: Difference Btw Win32 and MFC programming Pin
ThatsAlok17-Aug-04 0:49
ThatsAlok17-Aug-04 0:49 
GeneralCRC/checksum for a group of files Pin
Anthony_Yio16-Aug-04 17:54
Anthony_Yio16-Aug-04 17:54 
GeneralRe: CRC/checksum for a group of files Pin
Antony M Kancidrowski17-Aug-04 0:42
Antony M Kancidrowski17-Aug-04 0:42 
GeneralAnti-alias w/ GDI NOT GDI+ Pin
Tony Teveris16-Aug-04 16:46
Tony Teveris16-Aug-04 16:46 
GeneralHere's a good one. Pin
JD Steffen16-Aug-04 15:58
JD Steffen16-Aug-04 15:58 
GeneralRe: Here's a good one. Pin
Rory Solley16-Aug-04 21:27
Rory Solley16-Aug-04 21:27 
Your test variable is a pointer to a SINGLE char value. If you want to store an array of chars i.e. a string, you will have to declare an array:

char* pArray = new char[NumChars + 1];

where NumChars is the number of characters you want to store. If you don't know in advance how many you want to store, pick a large constant value. Note the extra one added to accommodate the null-terminator at the end of the string. This is a style issue, you may wish to include the null-terminator in the NumChars count.

Now when you use your pointer arithmetic:

StringData++;

you will be using valid allocated memory. Remember that when you come to deallocate an array, the syntax is as follows:

delete []pArray; // Note the square brackets

On a related note, you might want to look at the standard library's basic_string<> template (STL). use MSDN - it can simpify string handling a great deal and is a good way to learn about templates.

Hope that helps.
GeneralWinsock 2: Local IP address Pin
wooden0jesus16-Aug-04 14:25
wooden0jesus16-Aug-04 14:25 
GeneralRe: Winsock 2: Local IP address Pin
Antony M Kancidrowski16-Aug-04 22:56
Antony M Kancidrowski16-Aug-04 22:56 
GeneralRegRestoreKey huge delay on 2003 Pin
farby16-Aug-04 11:57
farby16-Aug-04 11:57 
GeneralProject Suggestions Pin
Archer28216-Aug-04 11:55
Archer28216-Aug-04 11:55 
GeneralRe: Project Suggestions Pin
Christian Graus16-Aug-04 12:16
protectorChristian Graus16-Aug-04 12:16 
GeneralRe: Project Suggestions Pin
David Crow17-Aug-04 3:38
David Crow17-Aug-04 3:38 
GeneralUsing a templated CView class with the MDI or SDI framework Pin
BAmity16-Aug-04 11:50
BAmity16-Aug-04 11:50 
GeneralLocking a combobox and handling CFormView closing Pin
BlackDice16-Aug-04 11:34
BlackDice16-Aug-04 11:34 
GeneralRe: Locking a combobox and handling CFormView closing Pin
David Crow17-Aug-04 3:55
David Crow17-Aug-04 3:55 
GeneralRe: Locking a combobox and handling CFormView closing Pin
BlackDice17-Aug-04 5:11
BlackDice17-Aug-04 5:11 
GeneralRe: Locking a combobox and handling CFormView closing Pin
David Crow17-Aug-04 5:51
David Crow17-Aug-04 5:51 
GeneralVisual C++ start problem...delay Pin
GuimaSun16-Aug-04 9:17
GuimaSun16-Aug-04 9:17 
GeneralRe: Visual C++ start problem...delay Pin
David Crow16-Aug-04 10:24
David Crow16-Aug-04 10:24 
GeneralRe: Visual C++ start problem...delay Pin
nnvidya16-Aug-04 23:03
nnvidya16-Aug-04 23:03 
GeneralRe: Visual C++ start problem...delay Pin
David Crow17-Aug-04 3:20
David Crow17-Aug-04 3:20 
GeneralRe: Visual C++ start problem...delay Pin
GuimaSun17-Aug-04 3:55
GuimaSun17-Aug-04 3:55 
GeneralRe: Visual C++ start problem...delay Pin
David Crow17-Aug-04 4:00
David Crow17-Aug-04 4:00 

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.