Added book examples
This commit is contained in:
19
C21/sprintf_example.c
Normal file
19
C21/sprintf_example.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int i;
|
||||
char FileName[100];
|
||||
|
||||
for ( i = 1 ; i < 10 ; i++)
|
||||
{
|
||||
//'Print' text into string
|
||||
sprintf(FileName , "file%d.dat" , i);
|
||||
|
||||
// Sidplay the name created
|
||||
printf("Current file name: %s\n", FileName);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user