This repository has been archived on 2023-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
VSMechatronics/Exercises/C21/sprintf_example.c

19 lines
320 B
C
Raw Permalink Normal View History

2022-04-08 15:12:38 +00:00
#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;
}