-4

Can someone please explain to me the meaning of the first parentheses in the following statement:

Window* win= (main_window*) glfwGetWindowUserPointer(main_window);
Tom Dorone
  • 1,575
  • 2
  • 9
  • 7

1 Answers1

1

Casting in C. Means that memory you get from function will be casted to main_window type of your structure or class you have.

This will help compiler to know everything about your data offsets in structure or class. It will also prevent any warnings from compiler.

This will be later assigned to win variable.

unalignedmemoryaccess
  • 7,246
  • 2
  • 25
  • 40