我刚刚安装了Dev C++,我正在学习C编程.我使用的代码是
#include <stdio.h>
int main()
{
printf("Hello world");
getch();
}
Run Code Online (Sandbox Code Playgroud)
我把它保存为.c文件.当我编译它工作正常,但当我编译并运行它说源文件没有编译.所以我搜索了buncha的东西,并在youtube上看到了这个视频,告诉你如何修复它.我还看到谷歌上的其他论坛提出同样的建议......然而,在做了什么之后问道,现在我甚至无法编译我的代码.我收到这个错误
Compiler: Default compiler
Executing C:\Dev-Cpp\bin\gcc.exe...
C:\Dev-Cpp\bin\gcc.exe "C:\Users\ubaid\Documents\C\Untitled1.c" -o "C:\Users\ubaid\Documents\C\Untitled1.exe" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
gcc.exe: Internal error: Aborted (program collect2)
Please submit a full bug report.
See <URL:http://www.mingw.org/bugs.shtml> for instructions.
Execution terminated
Run Code Online (Sandbox Code Playgroud)
我也用过这个链接上的问题,但仍然没有运气.. http://learntogeek.com/miscellaneous/solved-source-file-not-compiled-error-in-dev-cpp/
我正在使用Windows 8
如何输入一个单词并反转它的输出.我做了一个函数来计算单词的长度,从这里我必须根据单词的长度来反转单词.我怎样才能做到这一点?
#include<iostream>
using std::cout;
using std::endl;
using std::cin;
int LengthOfString( const char *); // declaring prototype for length of the string
int reverse(const char []);
int main()
{
char string1[100];
cout<<"Enter a string: ";
cin>>string1;
cout<<"Length of string is "<<LengthOfString(string1);
system("PAUSE");
return 0;
}
int LengthOfString( const char *x)
{
int index;
for(index = 0; *x!='\0';x++,index++);
return index;
}
int reverse(const char y[])
{
/* my attempted loop, its not right i know.
a[] = *index; // length of the …Run Code Online (Sandbox Code Playgroud)