C++ Basic 函数程序不会编译时出现大量错误

标签 c++

当我尝试用 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/

相关文章:

c++ - GTK TreeView /存储列扩展

c++ - 创建和管理 STL 列表的子列表

在我的用户定义类型上使用 boost::get 的 C++ Boost::variant 错误

c++ - C++中noexcept "violations"的静态分析

android - 错误 "cannot find -lrt"为 Android 构建 Boost

c++ - 对 `GdiplusStartup@12' 的 undefined reference

c++ - 使用 const 引用删除引用

c++ - 在 VS2010 中未经调试运行时发布版本不起作用

c++ - 不应该使用 Float 6 和 Double 15 可用数字吗?

c++ - 从类中返回指向 unique_ptr 的裸指针是否完全可以