#include <stdio.h> void main() { printf("hello world"); } 然后你可以用vc++6.0调试 就可以了
#include<stdio.h>#include <stdlib.h> int main() { printf("hello world"); system("pause"); return 0; }
#include void main() { printf("hello world"); }
这是肯定的,因为C语言认为出现空格即为字符串结束.在这里,hello后面紧跟一个空格,字符串实际到这结束 因此,出现了你的这个情况.
你是说写成2个文件:(1)文件名 string.txt 内容: printf("\nHello World");(2) )文件名 a.c 内容:#include <stdio.h> main(){#include "string.txt"; return 0; } 对吗?================= 这样写是可以的.string.txt 放在当前文件夹.编译 a.c
#include<stdio.h> void main() { while(1) printf("hello world"); }
#include "stdio.h" void main() { printf("Hello , world .\n"); }
char str[1024] = ""; scanf("%s",str); int len = strlen(str); for(int i = len -1; i>=0;i--) { printf("%c",str[i]); }
使用文件流相关的函数,如:FILE* pFile = 0; char* zHello = "helloworld"; pFile = fopen("file.out", "w"); if (pFile != 0) { fwrite(zHello, strlen(zHello), 1, pFile); fclose(pFile); } else { /* Error */ }