Click here to Skip to main content
15,911,139 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Code-a-phone Pin
Tom Wright29-Dec-04 4:19
Tom Wright29-Dec-04 4:19 
GeneralRe: Code-a-phone Pin
David Crow29-Dec-04 4:45
David Crow29-Dec-04 4:45 
Questionwhat is the error in the following code? (not giving the required output). Pin
babur khan28-Dec-04 3:38
babur khan28-Dec-04 3:38 
AnswerRe: what is the error in the following code? (not giving the required output). Pin
El Corazon28-Dec-04 4:15
El Corazon28-Dec-04 4:15 
GeneralRe: what is the error in the following code? (not giving the required output). Pin
Neville Franks28-Dec-04 9:09
Neville Franks28-Dec-04 9:09 
GeneralFinding type size Pin
Franz Klein28-Dec-04 2:21
Franz Klein28-Dec-04 2:21 
GeneralRe: Finding type size Pin
Chris Losinger28-Dec-04 3:08
professionalChris Losinger28-Dec-04 3:08 
GeneralRe: Finding type size Pin
Gary R. Wheeler28-Dec-04 4:35
Gary R. Wheeler28-Dec-04 4:35 
In order to determine the size of a variable in an arbitrary piece of C++ code, you must replicate a significant portion of the functionality in a compiler. This is a major task.

Given that you tried to determine the size of a type based on the sizeof the string containing the type name, I would guess you're fairly new to programming. First of all, the sizeof operator doesn't usually return anything meaningful with regards to the contents of a string, since strings are usually represented as a pointer. Usually you need to use a function or class method that returns the string length. Secondly, the length of the type name has nothing to do with size of the type itself. Here's a couple of examples:
class S {
   char data[100000];
};
class ThisIsATypeWithAVeryLongNameAndLotsOfWords {
   char data;
};
Both S and ThisIsATypeWithAVeryLongNameAndLotsOfWords are type names, but as you can see, the length of the name doesn't affect the size of the underlying type. S occupies 100000 characters, while ThisIsATypeWithAVeryLongNameAndLotsOfWords only uses one.

What are you trying to accomplish here?


Software Zen: delete this;
GeneralNewest file on ftp Pin
Dariusz M. Mikulski28-Dec-04 1:39
Dariusz M. Mikulski28-Dec-04 1:39 
GeneralProgress Bar in StatusBar Pin
Neelesh K J Jain28-Dec-04 1:04
Neelesh K J Jain28-Dec-04 1:04 
GeneralHide Internet Explorer Menu Bars and Toolbars Pin
Member 24341328-Dec-04 0:28
Member 24341328-Dec-04 0:28 
GeneralRe: Hide Internet Explorer Menu Bars and Toolbars Pin
gsaigopal28-Dec-04 0:31
sussgsaigopal28-Dec-04 0:31 
GeneralRe: Hide Internet Explorer Menu Bars and Toolbars Pin
Member 24341328-Dec-04 16:04
Member 24341328-Dec-04 16:04 
GeneralRe: Hide Internet Explorer Menu Bars and Toolbars Pin
Alok Bhardwaj29-Dec-04 19:16
Alok Bhardwaj29-Dec-04 19:16 
GeneralRe: Hide Internet Explorer Menu Bars and Toolbars Pin
Alok Bhardwaj29-Dec-04 19:35
Alok Bhardwaj29-Dec-04 19:35 
QuestionHow to prevent from inhertance Pin
Kiran Kumar Singani28-Dec-04 0:26
Kiran Kumar Singani28-Dec-04 0:26 
AnswerRe: How to prevent from inhertance Pin
Prakash Nadar28-Dec-04 0:34
Prakash Nadar28-Dec-04 0:34 
GeneralRe: How to prevent from inhertance Pin
virtualkirankumar28-Dec-04 0:40
virtualkirankumar28-Dec-04 0:40 
GeneralRe: How to prevent from inhertance Pin
Prakash Nadar28-Dec-04 0:46
Prakash Nadar28-Dec-04 0:46 
AnswerRe: How to prevent from inhertance Pin
jan larsen28-Dec-04 1:39
jan larsen28-Dec-04 1:39 
AnswerRe: How to prevent from inhertance Pin
CP Visitor28-Dec-04 2:34
CP Visitor28-Dec-04 2:34 
GeneralSmall Prolem with OptionTree Pin
Fenderman27-Dec-04 23:33
Fenderman27-Dec-04 23:33 
GeneralRe: Small Prolem with OptionTree Pin
Prakash Nadar27-Dec-04 23:48
Prakash Nadar27-Dec-04 23:48 
GeneralRe: Small Prolem with OptionTree Pin
Fenderman28-Dec-04 0:17
Fenderman28-Dec-04 0:17 
GeneralRe: Block Copying Data Pin
Prakash Nadar27-Dec-04 23:46
Prakash Nadar27-Dec-04 23:46 

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.