CompuServe Messages

STUDENT RESPONSE ANI3-B

    12-Mar-95 11:02:41
Fm: NAAUG 73204,3522
To: Jack S. Winberg 71513,1522
>>>Jerry>>> Also a few more general questions – I get the need for the formatting sections in printf(), but the use of quotes ("") confuses me. I thought that was used to denote string literals. The printf() function is a format function. It can be passed most variable types. "" are used for its format, not for variable properties. The format is: printf("prompt with variable placement designators",variables list); and it has to be in that order. So if we have an integer variable holding a value of 1, and a string variable holding a value of "Jack" and we want to have the status line read: Jack has 1 more program working. then we would use something like: int intval=1; char strval[]="Jack"; printf("%s has %d more program working.",strval,intval); The quotes here have nothing to do with "strings", they specify the prompting contents and the placements of variable values in those contents. <<<Jerry<<<