![]() |
|
#1
|
||||
|
||||
|
today’s Subjective Paper ( Mid Term 2010) date: 04-12-2010
Q: What operator do you use to assign a pointer the address of another variable or constant? (2marks) Q: Identify each of the following function as string conversion function or string manipulating function; • bouble atof (const char *nptr) • char *strcpy (char *s1,const char *s2) • --------------------------------------I forgot this one (2 marks) Q: What happens when we increment a pointer? (3 marks) Q: Can you use an assignment operator to assign the value of one C-string to another? (3 marks) Q: What is the purpose and syntax of the const keyword? (5 marks) Q: What will be the output of the following; #include using name space std: union Num { int Value I; float Value F; double ValueD; char Value C; }; Void main () { // Optional unionkeyword // Value I = 100 NumTestValue = {100}; cout \ nInteger = “ TestVal.ValueIendl; TestVal.Value F = 2.123; cout “Float=” TestVal.ValueFendl; cout”Uninitialzed double = “TestVal.Val D endl; cout”Some rubbish???”endl; TestVal.Value C = ‘U’; cout”character = ‘ TestVal.Valueendl; } (5 marks) |
![]() |
















Linear Mode


