Sams Teach Yourself C in 21 Days
A string is a sequence of characters terminated by the null character. A sequence of one or more characters enclosed in double ...
Answers 855 F Exercises 1.char letter = ‘$’; 2.char array[18] = “Pointers are fun!”; 3.char *array = “Pointers are fun!”; The c ...
{ newone[ctr] = orig[ctr]; } } The following is one of many possible answers:include <stdio.h> include <string.h> / ...
Answers 857 F Answers for Day 11 Quiz The data items in an array must all be of the same type. A structure can contain data ite ...
The code is as follows: ptr->value2 = 5.5; (*ptr).value2 = 5.5; The code is as follows: struct data { char name[21]; struct ...
Answers 859 F A variable with local storage class is visible only in the function where it is defined. A variable with external ...
return 0; } void print_value( int x) { printf(“%d”, x); } Because you’re declaring varas a global, you don’t need to pass it as ...
Answers 861 F int var = 99; void print_func(void); int main( void ) { int var = 77; printf( “Printing in function with local and ...
for ( ctr2 = 0; ctr2 < 25; ctr2++ ) { printf( “%c”, star); } } } This program actually works properly, but it could be bette ...
Answers 863 F return 0; } void print_letter2(void) { char letter2 = ‘=’; int ctr; /* this is a local variable */ /* it is differ ...
You might think that the defaultneeds to go at the bottom of the switchstate- ment, but this isn’t true. The defaultcan go anyw ...
Answers 865 F Buffered input is sent to the program only when the user presses Enter. Unbuffered input is sent one character at ...
Answers for Day 15 Quiz The code is as follows: float x; float *px = &x; float **ppx = &px; The error is that the statement use ...
Answers 867 F a.zis an array of 10 pointers to characters. b.yis a function that takes an integer (field) as an argument and re ...
Open the file using the fopen()library function. When using fopen(), you must specify the name of the disk file to open and the ...
Answers 869 F 6.strcmp()compares two strings, considering the case of the letters. (For example, ‘A’and‘a’are different.) strcmp ...
A type voidpointer can point to any type of C data object (in other words, it’s a generic pointer). By using a voidpointer, you ...
Answers 871 F Answers for Day 19 Quiz Type double. On most compilers, it’s equivalent to a long; however, this isn’t guaranteed ...
Answers for Day 20 Quiz 1.malloc()allocates a specified number of bytes of memory, whereas calloc() allocates sufficient memory ...
Answers 873 F These two expressions evaluate to the same result. Using exclusive ORwith 11111111 is the same as using the compl ...
«
39
40
41
42
43
44
45
46
47
48
»
Free download pdf