Detect datatype of variables in C - /g/ (#105705420) [Archived: 816 hours ago]

Detect datatype of variables in C
6/26/2025, 12:59:17 AM No.105705420
thumbnail_01
thumbnail_01
md5: d70efb382a8437fb9782a1b86600adc5๐Ÿ”
A simple Marco which uses generics in C to help you detect data type of any variable like you do with type() function in python .

My blog link: https://blog.insanelogs.xyz/posts/detect-datatype-of-variables-using-generics/
Replies: >>105705909 >>105705971 >>105706530 >>105706598 >>105706847 >>105707292 >>105708008
Anonymous
6/26/2025, 1:22:40 AM No.105705565
C23 has typeof and GCC (the actual real reference implementation for C in the 21st century) had it as an extension since I think 1995.
Replies: >>105706553
Anonymous
6/26/2025, 2:15:53 AM No.105705909
34323422
34323422
md5: 24fd6c1b4783805d9081c15121377f66๐Ÿ”
>>105705420 (OP)
>https://blog.insanelogs.xyz/posts/detect-datatype-of-variables-using-generics/

only works with primitive types otherwise you just get "default" and the only information you get out of it is the typename which by itself is almost useless.
Replies: >>105705971
Anonymous
6/26/2025, 2:24:34 AM No.105705971
>>105705420 (OP)
I'm this poster >>105705909
just wanted to say if my post came off harsh i didn't mean it. your solution is probably the best possible solution one can do in C without compiler extensions.
Anonymous
6/26/2025, 3:51:57 AM No.105706530
1680215036531123
1680215036531123
md5: a5dbb99f160227e9b669c788d1723056๐Ÿ”
>>105705420 (OP)
It's a compiler and it should not exists.
Anonymous
6/26/2025, 3:55:41 AM No.105706553
>>105705565
Even pcc has typeof()
Anonymous
6/26/2025, 4:02:27 AM No.105706598
Jens_Gustedt300x300
Jens_Gustedt300x300
md5: 6e35893c89062d6fee59342014af2412๐Ÿ”
>>105705420 (OP)
IMHO Jens Gustedt and the committee ruined the language, C99 still being the only good "usable" standard.
Replies: >>105706843
Anonymous
6/26/2025, 4:12:06 AM No.105706653
can everyone in this thread please reply with one racial slur to prove you are human
Replies: >>105706667 >>105707365 >>105707396
Anonymous
6/26/2025, 4:15:08 AM No.105706667
>>105706653
niggerfag
Anonymous
6/26/2025, 4:25:34 AM No.105706726
man ${variable}
>doesn't work
typedef whateveriwant garbagetypeican'tfigureout
problem solved
Replies: >>105706760
Anonymous
6/26/2025, 4:32:11 AM No.105706760
46328436287
46328436287
md5: a5227b99416189ce92b0a938598b97de๐Ÿ”
>>105706726
>typedef whateveriwant garbagetypeican'tfigureout

what does creating a type alias supposed to achieve? you still can't do something as simple as get the typename as string let alone do proper reflection.
Replies: >>105706852
Anonymous
6/26/2025, 4:48:19 AM No.105706843
>>105706598
thats a weird typo of c89
Anonymous
6/26/2025, 4:49:20 AM No.105706847
>>105705420 (OP)
C is not python you faggot. write C in C.
Anonymous
6/26/2025, 4:51:20 AM No.105706852
>>105706760
maybe the universe is telling you that you shouldn't be a programmer
Anonymous
6/26/2025, 5:12:51 AM No.105706962
Rust doesn't have this problem.
Anonymous
6/26/2025, 6:29:41 AM No.105707292
maxresdefault
maxresdefault
md5: b5437b2fa2c472a53005aee675b519fe๐Ÿ”
>>105705420 (OP)
MARCO!
TARMA!
ERI!
FIO!
Anonymous
6/26/2025, 6:44:45 AM No.105707365
>>105706653
faggernig
Anonymous
6/26/2025, 6:53:12 AM No.105707396
>>105706653
I canโ€™t help with that.
Anonymous
6/26/2025, 8:21:19 AM No.105707861
1722985287121910
1722985287121910
md5: 1e2b04117d11c833945b1cd2fb3ddbae๐Ÿ”
>C is not python you faggot. write C in C.
Anonymous
6/26/2025, 8:43:09 AM No.105707959
ip grabber thread. runtime type checking is impossible in C, op just wants your ips.
Anonymous
6/26/2025, 8:51:20 AM No.105707992
And the usecase of that is...?
Anonymous
6/26/2025, 8:55:21 AM No.105708008
>>105705420 (OP)
Does C have the template literals equivalent from Js, or like the f strings in python?