I'm trying to make a simple code in c language (Stupid question, but I'm learning), I dont understand that this code gives me an error ... I must be doing wrong, I can not know that I have to change...sorry for my English ... thanks in advance to all
#include <stdio.h>
#include <ctype.h>
char* to_up(char* str_);
int main()
{
char any_phrase[] = "This is a phrase";
printf("%s\n", to_up(any_phrase));
printf("%s\n", to_up("this is another phrase"));
return 0;
}
char* to_up(char* str_)
{
int i;
for (i=0; str_[i]; i++)
str_[i] = toupper(str_[i]);
return str_;
}