2011-10-10 86 views
0

当我尝试用g ++进行编译时,该程序给了我一个错误的全屏幕,但我甚至没有启动硬件部分。只是印刷说明。这里有什么问题?C++基本功能程序不会编译出现错误的屏幕

/* 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; 
} 
+1

有什么错误? –

+0

在图像中提供重叠。 http://imageshack.us/g/829/39224773.png/ –

回答

4

这里有一个问题:

<< endl < endl; 

它应该是:

<< endl << endl; 
+0

非常感谢,我仔细看了看,无法察觉任何事情。我现在真的很尴尬。它编译没有1错误 –

+0

@SamLaManna:不要尴尬。 G ++的错误信息是非常残酷的。 – Boann

+0

这不仅仅是G ++,它是大多数C++编译器。他们试图引入“概念”来使它们变得更好(http://en.wikipedia.org/wiki/Concepts_%28C%2B%2B%29),但它没有及时为C++ 11做好准备。 – Mysticial