|
The pointer itself is on the stack but it contains the address of another variable. This address can either be in stack or in heap (it depends where you allocated it).
Don't forget that pointers are variables too (they simply contain an address).
|
|
|
|
|
Christian Flutcher wrote: As you said all pointers are created on heap and others are on stack
Please, don't accuse me of saying such a thing. I never said it.
Heap memory will be allocated whenever you use the new operator for allocating memory or whenever you use dynamic memory allocation functions like malloc() , calloc() , etc.,
Christian Flutcher wrote: Person *personPointer = &person; // Where this will go?
Will be on the stack.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Oops It was not you. My appologies.
|
|
|
|
|
No need to apologize, I was just kidding.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Hi,
1. In Person anotherPerson, nothing is initialized then it will get Person::Person() constructor. So 'Unknown' will be the name and '0' will be the age.
2. you may be knowing about the difference between *person and anotherPerson is References vs. Pointers.
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
Thank you santhosh. Your help is much appreciated.
|
|
|
|
|
using innosetup while adding different folders (i.e "database" folder name )
i m using static path C:\database as destination folder so that during run time application gets files from database folder but if user or client machine has no directory such as C:\ or with different name then how it could be handled........
|
|
|
|
|
Hi,
Don`t ever give absolute path for files and database.
Always use relative path, then only your application can be safe if you are transferring it into client machine..
Use like this
CString path = "Database/data.mdb";
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
if i used path like this
CString path = "Database/data.mdb";
and i create exe and when install on other mashine and user run application from desktop then my application became unable to fine Database folder
error occurs
there is invalid path "C:\documents and settings\users\abc\desktop\database\data.mdb"
|
|
|
|
|
Hi,
You may not given the database file in the setup..
In the Setup file you need to add the database file.
you need to create a folder Database and add the database file in the folder.
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
You should use relative path.
To over come your problem you can use
GetModuleFileName[^] Function to get the executable path and add the path before "Database/data.mdb"
I hope that makes sense.
Regards,
Sandip.
|
|
|
|
|
in have created a struct info in my exe and i have set a value for cstringi.e. struct info{
CString name}.and i have set value for it in exe itself . Now i want to show that vale for name in my name editbox which is in DLL...
can any one tell how to call struct of exe into dll which show value of it(exe) in DLL..
|
|
|
|
|
Shared Memory[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Why shared memory? The DLL and EXE run as the same process - shared memory is usually used to communicate between two different processes.
Judy
|
|
|
|
|
If the DLL displays this editbox in response to a call from the EXE, just pass the string as one of the parameters to the call.
Judy
|
|
|
|
|
any example or sample u can show me????
|
|
|
|
|
Hi All
I have a String which have some information, i want to cut some part from this and stroe in different srting.
CString a;
a="d:\jhdjh\as.data"
i want to cut
\jhdjh\as.data
And store in
CString b;
plz help me
|
|
|
|
|
|
Use Find and Left functions of CString...
CString a= "d:\\jhdjh\\as.data";<br />
int nPos = a.Find( '\\' );<br />
CString b = a.Left( nPos );
|
|
|
|
|
Hi
Thx's for help.I try this it is working.
But it is working i different way.It is storing d in string b.
I want to cut d and store \\jhdjh\\as.data
Plz help..
|
|
|
|
|
knowvc wrote: I want to cut d and store \\jhdjh\\as.data
Sorry I misunderstood your question. If you want to do so, you can use the Right() function instead of Left().
If you are actually dealing with the file paths and you want to cut the drive information, its better to use PathSkipRoot[^]
|
|
|
|
|
Thx's Again it's help me
Problem solved..
|
|
|
|
|
Hi one more problem i have how can i add drive name and string.
i mean i want to add drive name
c:\\ and
LPCTSTR lp
LPCTSTR lp=file\\file.ed and i want to add here
CopyFile(st, "c:\\" + lp ,TRUE);
Plz help me
|
|
|
|
|
Better use a CString.
CString cs = "c:\\";<br />
cs += "file\\file.ed";<br />
CopyFile(st, cs,TRUE);
|
|
|
|
|