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/
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.
>>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.
>>105705420 (OP)I'm this poster
>>105705909just 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.
>>105705420 (OP)It's a compiler and it should not exists.
>>105705420 (OP)IMHO Jens Gustedt and the committee ruined the language, C99 still being the only good "usable" standard.
can everyone in this thread please reply with one racial slur to prove you are human
man ${variable}
>doesn't work
typedef whateveriwant garbagetypeican'tfigureout
problem solved
>>105706726>typedef whateveriwant garbagetypeican'tfigureoutwhat 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.
>>105706598thats a weird typo of c89
>>105705420 (OP)C is not python you faggot. write C in C.
>>105706760maybe the universe is telling you that you shouldn't be a programmer
Rust doesn't have this problem.
>>105706653I canโt help with that.
>C is not python you faggot. write C in C.
ip grabber thread. runtime type checking is impossible in C, op just wants your ips.
And the usecase of that is...?
>>105705420 (OP)Does C have the template literals equivalent from Js, or like the f strings in python?