Where do you put typedef?

Do i need to put typedef in main or in my class? or do i make it global? Do i put it in a seperate function? what d i do with typedefs?
bump
A typedef has whatever scope you define it to have.

If you create a global typedef, then the typedef has a global scope and is visible throughout the program.

If you create a typedef within a class declaration, then the typedef is known within that class. It can have public, protected or private visibility depending on where you define it within the class declaration.

If you define a typedef within a function, then it is only visible within that function.

Topic archived. No new replies allowed.