.
This commit is contained in:
22
bac2/os/chap0/ex2.c
Normal file
22
bac2/os/chap0/ex2.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
void capitalize(char string[]);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char test[] = "test";
|
||||
printf("%s\n", test);
|
||||
capitalize(test);
|
||||
printf("%s\n", test);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void capitalize(char string[]){
|
||||
int i = 0;
|
||||
while(string[i] != '\0'){
|
||||
string[i] = string[i] + 'A' - 'a';
|
||||
i++;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user