C only have functions, constants, defined types, macros (which disappear before the language itself is processed) and global variables (although rare, because it is unadvisable). One way to find the information is to look at the files header (.h
) where you have the statements.
I do not advise trying to learn this way in any language. It is better to look for a more structured way, probably a good book. It is even possible for a person to create his or her own method of study if he or she already has a good programming domain and is strongly self-taught with a proven effectiveness structure. Don’t try to guess what things do, learn what they really do and how to use it. Programming cannot be based on achism, voluntarism and trial and error. Look for the documentation. That’s the trick.
Just to complement, since the question doesn’t talk about it, but the other answer is misleading: C, like Python, has types for all data. C, unlike Python, has types for all variables. The types available by default in C are: char
, signed char
, unsigned char
, short
, unsigned short
, int
, unsigned int
, long
, unsigned long
, long long
, unsigned long long
, float, double, long double
, _Bool
or bool
(available in virtually all compilers), struct
, union
, array and pointer.
There are still some types defined purely in library, among them (not all) size_t
, intN_t
, int_leastN_t
, int_fastN_t
, intptr_t
, intmax_t
, included in <inttypes.h>
and <stdint.h>
.
Pointers and arrays end up, in a way, getting confused.
Pointers, as well as arrays, are always used in composition with other types. It serves both as a reference for a type, as well as for indicating a sequence of data of its type. The pointer can be composed including functions. The concept of string only exists in the literal between quotes and some functions in <string.h>
, at the bottom is just a pointer to char
.
It is possible to create your own types, usually through a struct
and typedef
.
I understand what the other answer meant, but it’s good to make it clear that dict
Python has very different semantics than struct
. In fact I think an even better comparison would be the Python class with the structure of C. At least in the simplest form of the class, it looks more like a struct
, yet it does not give the same guarantees. In fact the way to simulate a class in C is with struct
. Simulate a dict
requires something even more complex done on its own or using a ready-made library.
reading the library header file is kind of boring, and the IDE I use is not very good in that sense I use Codeblocks
– user45474