Meaning of Static and Const

Hi all!
Could anybody please explain to me the meaning and use of the keywords static and const ? And the meaning of const in the following code:

1
2
3
4
5
6
const idAASSettings *idAASLocal::GetSettings( void ) const {
	if ( !file ) {
		return NULL;
	}
	return &file->GetSettings();
}
(this is part of the Doom 3 Source Code)

Thanks in advance!
In this context, it's signifying that the function is read only and does not change the object for which it is called.

Static can be used in different ways. For example, you could have a function with a static variable in it, which will retain it's value throughout different calls to it. Or you could have a static member function of a class, which could be called without instantiating an object of that class.

Have a quick Google, you'll find a few examples.
Topic archived. No new replies allowed.