First of all, in general you are much better off using igraph from R or Python, attributes are much-much better supported. For example you can easily select vertices or edges based on attribute values, etc. In C, the support for attributes is minimal, and you are mostly on your own, when it comes to working with them. So, unless you really need C, I would suggest to use R or Python.
If you still want C, then the first thing to keep in mind is that you need to include
igraph_i_set_attribute_table(&igraph_cattribute_table);
in your code before you do anything with attribute explicitly or implicitly. Ie. even if you don't manipulate attributes explicitly, but create a graph that might have some attributes, eg. read a graph a GraphML file, you need this call before, otherwise the attributes are dropped. It is best to include the call at the beginning of your main()
function.
It is not true that you have to use any attributes, I am not sure what you mean by that.
As for setting and querying the attributes, see the files in the examples/simple
directory:
https://github.com/igraph/igraph/blob/master/examples/simple/cattributes.c https://github.com/igraph/igraph/blob/master/examples/simple/cattributes2.c https://github.com/igraph/igraph/blob/master/examples/simple/cattributes3.c https://github.com/igraph/igraph/blob/master/examples/simple/cattributes4.c
These examples are largely artificial, because they are mainly used for testing purposes, but they show the basic usage.