How do we create datatypes in C++. Eg. creating datatype called "myowndatatype" with sizeof(myowndatatype) = 3
chound
1
Junior Poster
Recommended Answers
Jump to PostGreetings chound,
C provides typedef, a facility for creating new data type names. It makes your name a synonym of the defined data-type:
typedef int Number;
The type Number can be used in declarations and casts in exactly the same ways that the defined type int …
Jump to PostC provides a compile-time unary operator called sizeof that can be used to compute the size of any object:
sizeof (type name)
It is impossible to set data to a variable using the sizeof operator, as its only purpose is to tell you the size of your …
All 8 Replies
C#Coder
0
Newbie Poster
Stack Overflow
8
Junior Poster
chound
1
Junior Poster
Stack Overflow
8
Junior Poster
C#Coder
0
Newbie Poster
Chainsaw
12
Posting Pro in Training
SLY985
0
Newbie Poster
BARI DANIYAL
commented:
can you give full code for begeiners because they dont about c++
+0
ravenous
266
Posting Pro in Training
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.