void *ptr;
myStruct myArray[10];
ptr = myArray;
char* myFunc (char *ptr)
{
ptr += 3;
return (ptr);
}
int main()
{
char *x, *y;
x = "HELLO";
y = myFunc (x);
printf ("y = %s \n", y);
return 0;
}
struct node *nPtr, *sPtr; /* pointers for a linked list. */
for (nPtr=sPtr; nPtr; nPtr=nPtr->next)
{
free(nPtr);
}
The sample code above releases memory from a linked list. Which of the choices below accurately describes how it will work?
int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
What value does testarray[2][1][0] in the sample code above contain?
int a=10,b;
b=a++ + ++a;
printf("%d,%d,%d,%d",b,a++,a,++a);
what will be the output when following code is executed
int x[] = { 1, 4, 8, 5, 1, 4 };
int *ptr, y;
ptr = x + 4;
y = ptr - x;
What does y in the sample code above equal?
void myFunc (int x)
{
if (x > 0)
myFunc(--x);
printf("%d, ", x);
}
int main()
{
myFunc(5);
return 0;
}
What will the above sample code produce when executed?
11 ^ 5
What does the operation shown above produce?
#define MAX_NUM 15
Referring to the sample above, what is MAX_NUM
Which one of the following functions is the correct choice for moving blocks of binary data that are of arbitrary size and position in memory?
int x = 2 * 3 + 4 * 5;
What value will x contain in the sample code above?
int var1;
If a variable has been declared with file scope, as above, can it safely be accessed globally from another file?
time_t t;
Which one of the following statements will properly initialize the variable t with the current time from the sample above?
int x = 0;
for (x=1; x<4; x++);
printf("x=%d\n", x);
What will be printed when the sample code above is executed?
int x = 3;
if( x == 2 );
x = 0;
if( x == 3 )
x++;
else x += 2;
What value will x contain when the sample code above is executed?
char *ptr;
char myString[] = "abcdefg";
ptr = myString;
ptr += 5;
What string does ptr point to in the sample code above?
x = 3, counter = 0;
while ((x-1))
{
++counter;
x--;
}
Referring to the sample code above, what value will the variable counter have when completed?
char ** array [12][12][12];
Consider array, defined above. Which one of the following definitions and initializations of p is valid?
char buf [] = "Hello world!";
char * buf = "Hello world!";
In terms of code generation, how do the two definitions of buf, both presented above, differ?
Which one of the following will read a character from the keyboard and will store it in the variable c?