-
C++ constructs
What does c++ constructs mean??
I'm asking that coz i've been asked to do al listing of all the C++ constructs used in my assigment.
Does construct mean all the things that exist in C++ but not in C ( coz i'm converting from C++ to C )?? Eg vectors , cin , cout , string, endl ....
-
I do hope it is a small project that one of which they ask you to name ths constructs you used. :)
A language construct is basically a part of your program that can be formed by one or more tokens and that is in accordance with the language rules and forms a "language sentence". A token is a string of characters allowed by the language dictionary that, together, form an elemental unit of meaning.
So...
int is a token. as is the symbol +, or the operator ::
int sum_2_numbers (int x, int y) is a construct of the type function.
int x is a construct known as variable declaration or assignment (on this case your construct is dependant on the context of where it is built)
class MyClass { /* ..... */ } is a construct of the type class
So on, so on...
Basically what I believe you are being asked is to list all language features you addressed in your project.
Typically this will be,
Code:
variable constructs,
constant constructs,
function constructs,
class constructs,
array constructs,
string (if you are using the STL defined type) constructs,
etc...
Hope this helps somehow
-
-
An errata:
I'm learning C++ myself and I will definitely fall on these traps for a long time. On the above, int x is a variable definition. Not a variable declaration. In fact, it is a variable declaration and definition. Only way to declare a variable without also defining it is by the use of the extern keyword...