Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // single line comment
- /* multi
- line
- comment*/
- /*
- constants are typed values that can't be changed and
- must be initialized. Their address can't be taken.
- */
- const int ANSWER = 42;
- /*
- variables are a typed mutable value.
- It's declaration consists of a type and a name
- and may also define an initial value.
- */
- int variable;
- int variable = 10;
- int variable = 0x10;
- /*
- variables may also have a storage class
- specifier that defines where the variable is
- stored and how it's memory is shared.
- */
- private int variable; // one per instance
- static int variable; // one per thread
- private static int variable; // one per instance and thread
- global int variable; // one per process (default)
- shared int variable; // one per executing system
- /*
- methods are declared by a type and a name
- followed by an argument list enclosed in
- round brackets.
- parameters are separated by commands are are
- declared ba a type followed by the parameter
- name.
- each method header declaration must follow a method
- body enclosed in curly brackets.
- each method can be exported by placing an 'export'
- keyword in front of the method header.
- */
- int main()
- {
- return 1;
- }
- int square(int i)
- {
- return i * i;
- }
- export int sum(int a, int b)
- {
- return a + b;
- }
Advertisement
Add Comment
Please, Sign In to add comment