Can someone explain Typedef to me in really simple language? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Can someone explain Typedef to me in really simple language?

Typedef declaration do not define new types ; they introduce a synonym for existing type,they don't affect the over loading mechanism.

2nd Jun 2017, 1:06 PM
Jatin Srivastava
Jatin Srivastava - avatar
3 Antworten
+ 6
This is quite simple actually. Type def is used by variables mostly and as you know there are e few differences. You have : 1 Characters or also Strings if you use more then one letter. 2 Integers. Numbers that are whole like 12 or 3 or 899 without a decimal 3 Boolean 4 Hexadecimal numbers 5 double numbers 6 Floating numbers Just to give you an idea, hope you get it.
2nd Jun 2017, 2:11 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 5
You have answered the question by yourself. It is just assigning a new name to existing datatype or user defined datatype. For instance, I use unsigned long long datatype occasionally, in order to reduce typos l would create a typedef for the same. typedef unsigned long long bigint; Now it would be more effective and easy to use the short typename instead of lengthy one. bigint num1; is more elegant statement than unsigned long long num1;
2nd Jun 2017, 5:08 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
+ 1
following
2nd Jun 2017, 5:26 PM
Isomer
Isomer - avatar