A user doesn't enter a data type. They enter data that is put into a variable which is defined by a data type at compile time. So at compile time the data type size is already defined and can be output using sizeof(<em>datatype/variable</em>) .
WaltP
Posting Sage w/ dash of thyme
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
Then you need to create a mapping from data type to size and store it in a file. Once you've done that just search that file for the data type you are interested in.
Although, as WaltP has already mentioned, the size of a type is available at compile time using sizeof .
L7Sqr
Practically a Master Poster
657 posts since Feb 2011
Reputation Points: 201
Solved Threads: 124
i want something like this
i want to search a file for various data types and print the sizes of them acordingly
Post some examples of what will be in the file so that we don't have go guess that you want.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343