|
-
September 7th, 1999, 04:26 AM
#1
How to get the size of a pointer for LPSTR?
I would like to get the size of the whole data in lpSTR in the following
after I insert some 'data' into data.
int *data = new int[100];
LPSTR lpStr;
lpStr = (LPSTR) data; //I am trying to convert the 'int'data to 'LPSTR'data.
// is this correct ?
//insert data
delete [] data;
What is the command for obtaining the size of lpStr ?
Please help me!
I would like to appreciate your help in advance.
-
September 7th, 1999, 08:24 AM
#2
Re: How to get the size of a pointer for LPSTR?
The size of lpStr is based on the number of integers you put into data (0 to 100) multiplied by the size of an integer (4 bytes).
Alvaro
-
September 7th, 1999, 11:25 AM
#3
Re: How to get the size of a pointer for LPSTR?
#define MAXINT 100
int *data = new int[MAXINT];
LPSTR lpStr;
lpStr = (LPSTR) data;
int tmp = sizeof(data);
int tmp2 = sizeof(lpStr);
// both tmp and tmp2 will equal 4, the size of a pointer (not the size of data that is being pointed at).
// so one way to figure the size out would be something like this:
int tmp3 = sizeof(data) * MAXINT;
delete [] data;
I am curious as to what you are going to use the lpStr variable for.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|