|
you can have as many levels of indirection as you want.
char *************** p = NULL; is perfectly valid.
Richie308 wrote: the level of indirection is an attribute that belongs to the specific symbol being declared
i believe this is correct.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Chris Losinger wrote: char *************** p = NULL; is perfectly valid.
Wow, I think you're right. I tried it, and it compiled without error!
This really answers my question, thank you Chris.
|
|
|
|
|
Chris Losinger wrote: you can have as many levels of indirection as you want.
char *************** p = NULL; is perfectly valid.
Its been a while, but I believe this is actually limited to something like 17 levels (not that you would ever need that many). I'd have to look it up myself, but I remember that the dimensions of arrays are limited to 17 (or somewhere around there) ... I believe pointer levels are as well.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Zac Howland wrote: something like 17 levels
just the thought makes me giggle.
char *****************p = NULL;
p = new char****************[n];
p[0] = new char***************[n];
p[0][0] = new char**************[n];
p[0][0][0] = new char*************[n];
p[0][0][0][0] = new char************[n];
p[0][0][0][0][0] = new char***********[n];
...
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
You laugh ... but sadly, I've seen people try to make 20-dimensional arrays and wonder why they get compiler errors ... not to mention logic errors :P
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
I really like your sig!
|
|
|
|
|
It's the first.
My reasoning: a pointer is a variable that stores an address, which is always 32 bit in a 32-bit OS, regardless of what type of instance it points to.
Best,
Jun
|
|
|
|
|
You listed 3 types:
char
ptr to char
ptr to ptr
They are not the same.
In the case of a pointer, it matters what type it points to in case you want to do arithmetic on the pointer value, such as incrementing it for example.
C++ allows any number of levels of indirection.
|
|
|
|
|
Hello there.
Does anybody know how to hide or don't show the child window caption in the "Windows" menu of its Client Window?
I don't want the "Windows" menu of a Client window show some of its childs windows captions.
Thanks.
|
|
|
|
|
Did you Mean :-
FWS_ADDTOTITLE
or the one in the window Menu of the parent frame then the application calls CWnd::DrawMenuBar you can choose here wether you need to add the menu.
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
Thank you for your answer.
I meant:
I have an MDI App.
Anytime the App creates a child window, the caption (title of the child window) is showed by the menu "Window" of the frame (the client).
Ex:
The App creates (in this order) 2 childs windows whose titles (captions) are "Document A" and "Document B"
Then, the "Window" menu of the frame window (the client) is showed as fallow:
Window
--Cascade
--Tile horizontal
--Tile vertical
--Arrange icons
...........
1 Document A
2 Document B
The problem is that I don't want the "Window" menu of the frame window show the titles of the child windows created.
If you could help me with this...thank you very much.
John.
|
|
|
|
|
|
It is equivelent to
ObjectRoot::ms_instances[ ObjectRoot::ms_numInstances ] = this;
ObjectRoot::ms_numInstances++;
Good to see you are hooked up with HLA stuff. Hope you enjoy it
Best,
Jun
|
|
|
|
|
1) It returns the current value of ObjectRoot::ms_numInstances (which is a static integer representing the number of current instances the array has pointers for).
2) It sets the last unset element in the array (that is the first NULL array element -- represented by ObjectRoot::ms_instances[ObjectRoot::ms_numInstances]) to the value of the current object.
3) ObjectRoot::ms_numInstances is incremented by 1 (set to the next NULL value in the array).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
How do I bring up the MFC ClassWizard in Visual C++ .NET edition? I cannot seem to find it.
Thanks,
G
cpp@nearsphere.com
|
|
|
|
|
See here.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Can you tell me the function to convert ansi string to utf-8 string?
|
|
|
|
|
Have you tried MultiByteToWideChar() or WideCharToMultiByte() ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
If no other solutions, I think you can try successive calls of MultiByteToWideChar and WideCharToMultiByte . First call converts the ANSI string to Unicode format, and then the second call converts to UTF-8 format:
char ansi[] = "Ansi String";
wchar_t unicode[100];
char utf8[100];
MultiByteToWideChar(CP_ACP, 0, ansi, -1, unicode, 100);
WideCharToMultiByte(CP_UTF8, 0, unicode, -1, utf8, 100, NULL, NULL);
Hope it works.
|
|
|
|
|
See Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
Hello there,
again i need some help. I have to write an application to get several information from the MSN Messenger. I've used the IMessengerApp / IMessengerIMWindows and several other classes. It works well, but now I've recognised that it only works with msmsg.exe and not with msnmsgr.exe.
But about msnmsgr.exe i don't find anything (Typelibs, Application-Ids and so on)
Does anyone know how to retrieve information like current user or online state ?
Would be great if someone could help me
thanks
|
|
|
|
|
A lot of the MSN IM features that used to be accessible thru automation were removed a few versions ago (for security reasons, probably)
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
Can you perhaps tell me which IM-Functions were removed ?
|
|
|
|
|
I use the following to Open a file on an FTP server. Below is used . Now after i use OpenFile, is there a way to play the file without storing it to disk. I would like to just have the video played without having to store to disk and then use something like ShellExecute to play. Cause now i will have to be concerned about deleting the file. I only have an FTP server to work with. Is there a way to maybe save in memory and execute from memory using some know API?
CString filenam = "0015.avi";
m_pFtpConnection = m_Session.GetFtpConnection (ftpServer,userName, password, port, TRUE);
CInternetFile* pfRemoteFile=m_pFtpConnection->OpenFile( filenam, GENERIC_READ, FTP_TRANSFER_TYPE_BINARY, 1 );
|
|
|
|
|
I guess what i am attempting to replicate is when you attempt to play a video clip from some sites you get the option to open and play or save to disk. I would just like to automatically open and play without having to save to disk...
|
|
|
|