Click here to Skip to main content
16,011,538 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Which method of CFile return if the pointer arrived to the end of the file ? URGENT !!! Pin
Chris Meech21-Jun-01 9:09
Chris Meech21-Jun-01 9:09 
GeneralI did not understand you ! Who are "them" ???? Pin
21-Jun-01 9:18
suss21-Jun-01 9:18 
GeneralPlease ! answer me ! This is URGENT !!! HELP !!! Pin
21-Jun-01 11:12
suss21-Jun-01 11:12 
GeneralRe: Please ! answer me ! This is URGENT !!! HELP !!! Pin
Carlos Antollini21-Jun-01 11:19
Carlos Antollini21-Jun-01 11:19 
GeneralWhat's wrong here??? Pointer question Pin
21-Jun-01 8:23
suss21-Jun-01 8:23 
GeneralRe: What's wrong here??? Pointer question Pin
Tim Deveaux21-Jun-01 8:49
Tim Deveaux21-Jun-01 8:49 
GeneralRe: What's wrong here??? Pointer question Pin
Richard Cheng21-Jun-01 8:56
Richard Cheng21-Jun-01 8:56 
GeneralRe: What's wrong here??? Pointer question Pin
Tim Deveaux21-Jun-01 9:21
Tim Deveaux21-Jun-01 9:21 
Ah - ok - didn't look at your code carefully enough.

What you are doing is going to act differently in debug, release, and where the pointer is declared (in a function (on the stack) or global (on the heap). You will be able to store to the pointer as long as the increment doesn't take it outside of a valid memory location (which would be an access violation). But you will probably end up overwriting some other important data, which can corrupt the heap or the stack.

What you are looking for is, I think, a dynamic array - one which you can assign values to and have the array allocate more memory 'on the fly' to accomodate if necessary.

The STL's vector would be useful in this case - very handy. If you'd like to roll your own, you might want to look at MSPutils.h (in the platform SDK), which implements a simple placement new based container for Plain Old Data (POD) types - A related class is CSimpleArray, which extends this to classes with constructors and destructors.

But I think you should look at CArray (MFC) or vector (STL).
GeneralRe: What's wrong here??? Pointer question Pin
Tomasz Sowinski21-Jun-01 9:12
Tomasz Sowinski21-Jun-01 9:12 
GeneralRe: What's wrong here??? Pointer question Pin
Chris Meech21-Jun-01 9:14
Chris Meech21-Jun-01 9:14 
GeneralRe: What's wrong here??? Pointer question Pin
21-Jun-01 9:17
suss21-Jun-01 9:17 
GeneralRe: What's wrong here??? Pointer question Pin
Tomasz Sowinski21-Jun-01 9:35
Tomasz Sowinski21-Jun-01 9:35 
GeneralRe: What's wrong here??? Pointer question Pin
Chris Meech21-Jun-01 10:31
Chris Meech21-Jun-01 10:31 
GeneralRe: What's wrong here??? Pointer question Pin
Chris Meech21-Jun-01 10:33
Chris Meech21-Jun-01 10:33 
GeneralRe: What's wrong here??? Pointer question Pin
markkuk24-Jun-01 21:21
markkuk24-Jun-01 21:21 
GeneralRe: What's wrong here??? Pointer question Pin
21-Jun-01 9:19
suss21-Jun-01 9:19 
GeneralTHANK YOU SOOOOO MUCH!!!! Pin
Richard Cheng21-Jun-01 10:38
Richard Cheng21-Jun-01 10:38 
GeneralRe: What's wrong here??? Pointer question Pin
Rejeesh21-Jun-01 22:41
Rejeesh21-Jun-01 22:41 
Generalcouldnt create empty document message Pin
21-Jun-01 8:01
suss21-Jun-01 8:01 
GeneralLooking for info on wring visitors in C++ Pin
Ben Burnett21-Jun-01 7:30
Ben Burnett21-Jun-01 7:30 
GeneralRe: Looking for info on wring visitors in C++ Pin
Tomasz Sowinski21-Jun-01 7:47
Tomasz Sowinski21-Jun-01 7:47 
GeneralRe: Looking for info on wring visitors in C++ Pin
Ben Burnett21-Jun-01 9:13
Ben Burnett21-Jun-01 9:13 
GeneralSyntax question... Pin
John Uhlenbrock21-Jun-01 6:23
John Uhlenbrock21-Jun-01 6:23 
GeneralRe: Syntax question... Pin
Tim Deveaux21-Jun-01 6:46
Tim Deveaux21-Jun-01 6:46 
GeneralOpening/Editing a simple text file Pin
21-Jun-01 6:15
suss21-Jun-01 6:15 

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.