Adding file

This commit is contained in:
Scott C. MacCallum 2023-01-24 21:50:35 -05:00
parent 6b888cc718
commit 3562af25e7
1 changed files with 23 additions and 0 deletions

23
array.c Normal file
View File

@ -0,0 +1,23 @@
#include <stdio.h>
#include <stdlib.h>
void print_array(char *pstr) {
for (unsigned int i=0; i<10; i++) {
printf("%c", *pstr++);
}
}
int main(void) {
static char str[11];
for (unsigned int i=0; i<10; i++) {
str[i]='0'+i;
}
str[10]='\0';
print_array(str);
return EXIT_SUCCESS;
}