I am back again with a new query...preparing for technical interview questions
---------------------------------
Without using sizeof operator,can we find sizeof datatype.
SpS
34
Posting Pro
Recommended Answers
Jump to PostMy first reaction would be to say that sizeof is part of the language and go down that path...
But one technique that might be used is to declare an array of a least two of the objects, declare two pointers to char; then cast & assign the address …
Jump to Postnot guaranteed to work for all types. Some it will, some it wont. Theres no standard way of doing this. Its no coincidence that sizeof is a keyword.
Jump to Postnot guaranteed to work for all types. Some it will, some it wont. Theres no standard way of doing this. Its no coincidence that sizeof is a keyword.
Could you elaborate, please?
All 11 Replies
Dave Sinkula
2,398
long time no c
Team Colleague
SpS
34
Posting Pro
Stoned_coder
6
Junior Poster
Dave Sinkula
2,398
long time no c
Team Colleague
Stoned_coder
6
Junior Poster
Stoned_coder
6
Junior Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Stoned_coder
6
Junior Poster
Rashakil Fol
978
Super Senior Demiposter
Team Colleague
Stoned_coder
6
Junior Poster
Stoned_coder
6
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.