g++ 甚至不会编译它。我哪里错了?这些是错误消息:
gcc sign.c sign.c:在函数âmainâ:sign.c:35:2:警告:格式不是字符串文字并且没有格式参数[-Wformat-security]
==================================================== =================================
#include "stdio.h"
int string_length(char str[]);
void string_sort(char s[]);
void string_sort(char s[])
{
char tmpt;
int i, j, len;
len=string_length(s);
for(i=0; i<len-1; i++){
for (j=i+1; j<len; j++){
if (s[i] > s[j]){
tmpt=s[i];
s[i]=s[j];
s[j]=tmpt;
}
}
}
}
int string_length(char str[]){
int i;
for(i=0; i<80; i++){
if(str[i]=='\0'){
return(i);
}
}
}
int main(){
char words[80];
scanf("%s", words);
printf(words);
string_sort(words);
printf(" ");
printf(words);
printf("\n");
while ( words != " "){
scanf("%s", words);
printf(words);
string_sort(words);
printf(" ");
printf(words);
printf("\n");
}
}