C version of class Name

How to get variable type in c? The c object has className, php has get_class (), etc.

+3
source share
6 answers

You look in the source code and find the type; since there are no dynamic types in C, a static type is all there is.

+5
source

You cannot do this. C gives absolutely no way to switch to a variable type.

+3
source

. C , . .

+1

- sizeof , "" , .
, , , , , .

+1

, C . C, - .

,

  • , .
  • , printf(),

, , , , / . , . , , , .

+1

C, . C id. void , , , - - , .

, , C .

(* Note: I discount the unions, as they are their type, and the real question is what type do you want to get out of it.)

0
source

Source: https://habr.com/ru/post/1743584/


All Articles