473,320 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Error C2143

I have the following code:

#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <cstdlib>
#include <conio.h>
#include "stdinfo.h"

using namespace std;

//void checkStatus( fstream& );
//int checkGrades( int, int, int, int );

int main()
{
fstream outStudentFile( "data.txt", ios::in | ios::out );

if ( !outStudentFile ) {
cerr << "File could not be opened for output. " << endl;
exit( 1 );
}

cout << "Please enter the following information in the file. "
<< "Use -1 to end input. " << endl << endl;

studentdata student;

cout << "Please enter ID Number (Enter -1 to end input): ";
cin >> student.idnumber;

while ( ( student.idnumber ) != -1 ) {
cout << "Enter First and Last Names: ";
cin >> student.firstName >> student.lastName;
cout << "Enter Status (I or A): ";
cin >> student.status;
checkStatus ( outStudentFile );
cout << "Enter 4 Grades: " ;
cin >> student.grade >> student.grade1 >> student.grade2
student.grade3;


outStudentFile << student.idnumber << " " << student.firstName << "
" << student.lastName
<< " " << student.status << " " << student.grade << " " <<
student.grade1
<< " " << student.grade2 << " " << student.grade3 << '\n';

cout << "\nPlease enter ID Number (Enter -1 to end input): ";
cin >> student.idnumber;
}

outStudentFile.clear();
outStudentFile.close();

return 0;

}

Do you have any idea why I'm getting the following error when
compiling?
Compiling...
sfile.cpp
C:\Documents and Settings\Rhodrey Shaw\My Documents\Data
Structures\sfile.cpp(9) : error C2143: syntax error : missing ';'
before 'using'
Error executing cl.exe.

sfile.obj - 1 error(s), 0 warning(s)
Jul 19 '05 #1
2 10429
On 21 Sep 2003 00:25:20 -0700, rh*****@hotmail.com (Rhodrey) wrote:
I have the following code:

#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <cstdlib>
#include <conio.h>
#include "stdinfo.h"

using namespace std;

...

Do you have any idea why I'm getting the following error when
compiling?
Compiling...
sfile.cpp
C:\Documents and Settings\Rhodrey Shaw\My Documents\Data
Structures\sfile.cpp(9) : error C2143: syntax error : missing ';'
before 'using'


Apply logic. It's a missing semicolon before the word 'using'.
Where can that be? Most probably in [stdinfo.h], whatever that
header file is.

Btw., in case you don't know, <conio.h> is not a standard C++ header.

Jul 19 '05 #2

"Rhodrey" <rh*****@hotmail.com> wrote in message
news:ff*************************@posting.google.co m...

Do you have any idea why I'm getting the following error when
compiling?
Compiling...
sfile.cpp
C:\Documents and Settings\Rhodrey Shaw\My Documents\Data
Structures\sfile.cpp(9) : error C2143: syntax error : missing ';'
before 'using'
Error executing cl.exe.

sfile.obj - 1 error(s), 0 warning(s)


As Alf wrote it's probably a missing ';' in the stdinfo.h file, which
probably contains the declaration of the studentdata class:

class studentdata
{
....
}; // remember the ';' here!?
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
3
by: Andrew Luke | last post by:
Hi all you C++ guru's! I'm 'very, very' new to C++ and I'm having a little trouble configuring my VS environment I think - when I try and compile some sample code I'm getting the following...
1
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me...
2
by: Qiao Yun | last post by:
I used vc++.net (visual studio .net ) to open a project which can work well in vc++6.0. I succeeded in compiling the project in vc++.net in release mode . But when I tried to compile the project...
0
by: Shashikiran Prabhakar via .NET 247 | last post by:
(Type your message here) Hi, I am not very conversent in VC++, but the requirement for me is to run a rendering code. However i am encountering the following errors. c:\Program...
18
by: George2 | last post by:
Hello everyone, What is wrong with the code, I just want to allocate an array of 100 void* pointers. :-) int main() { void** p;
3
by: sphenxes | last post by:
#include <cmath> #include <ctime> #include <cstdlib> #include <iostream> using namespace std; struct Pharmacology{ string genericName; string tradeName; string classification;
8
by: =?GB2312?B?yum09MXt?= | last post by:
today I forgot to include some header,then I found the error message by the compiler is quite strange. so I want to know exactly the inner details of the compiler impletation,if possible. and I...
15
by: madhu.ab | last post by:
Hi All, I am getting the following errors when i am including header file winuser.h I dont know whats happening. How will an error occur in winuser.h?? Please help. \microsoft visual...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.