当我尝试用 g++ 编译它时,这个程序给我一个完整的错误屏幕,但我什至没有开始困难的部分。只是打印说明。这里有什么问题?
/* Samuel LaManna
CSC 135 Lisa Frye
Program 2 Functions (Shipping Charges)
Calculate the shipping and total charge
for shipping spools of wire
*/
#include <iostream>
using namespace std;
void instruct(); //Function Declaration for instruction function
int main()
{
instruct(); // Function to print instructions to user
return 0;
}
/********************************************/
// Name: Instruct /
// Description: Print instructions to user /
// Parameters: N/A /
// Reture Value: N/A /
/********************************************/
void instruct()
{
cout << "This program will calculate the shipping information "
<< "for a batch of wire spools. " << endl < endl;
return;
}
最佳答案
这是一个问题:
<< endl < endl;
应该是:
<< endl << endl;
关于C++ Basic 函数程序不会编译时出现大量错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7719947/