View Single Post
Old 08-31-2015, 05:16 AM   #2
Scruffman
FFR Player
 
Scruffman's Avatar
 
Join Date: Feb 2013
Posts: 1
Default Re: [University - C++ Programming] Help With Assignment (Very Basic Stuff)

You're sort of on the right track.

a) The answer is not void. GUI_BUFFER has been defined as a type alias which means it refers to a previously defined type in the code, acting like a legend for complex types so your code is more understandable. If you find where GUI_BUFFER has been assigned with the using keyword, the value is the data type assigned. typedef is also very similar to using, you may want to review this Stack Overflow post for a better breakdown between the two:
Code:
http://stackoverflow.com/questions/10747810/what-is-the-difference-between-typedef-and-using-in-c11
b) You are along the right track, you might want to review this link which gives a broad overview:
Code:
http://www.learncpp.com/cpp-tutorial/43-static-duration-variables/
Regarding performance, static variables are initialized only once which can have a major benefit over say a function which needs to keep initializing a variable (such as an integer array) each time it is run. You should also review where static values are stored (Heap or Stack) and that can help you get a better idea regarding performance.
Scruffman is offline   Reply With Quote