473,386 Members | 1,741 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,386 software developers and data experts.

What is the cause of declaration syntax error?

Expand|Select|Wrap|Line Numbers
  1. #include<iostream.h>
  2. #include<stdio.h>
  3. #include<fstream.h>
  4. #include<conio.h>
  5. void main()
  6. {
  7.      clrscr();
  8.      char i;
  9.      ofstream fout("C:\\TurboC4\\TC\\BIN\\Article.txt"ios::out)
  10.      if(!fout.fail()) //error <<<<<<<<<<<<
  11.      {
  12.           cout<<"/nOpened successfully"
  13.           cout<<"/nEnter character:";
  14.           i=getchar();
  15.           while(i!=$)
  16.           {
  17.                fout.put(i);
  18.                i=getchar();
  19.           }
  20.      }
  21.      else
  22.      {
  23.           cout<<"/nError in Opening";
  24.      }
  25.      fout.close();
  26.      ifstream.fin("C:\\TurboC4\\TC\\BIN\\Article.txt"ios::in);
  27.      i=fin.get();
  28.      cout<<"\nCurrent Contents";
  29.      while(!fin.eof())
  30.      {
  31.           cout<<i;
  32.           i=fin.get()
  33.      }
  34.      fin.close();
  35.      getch();
  36.      return;
  37. }

I'm getting a declaration syntax error at line 10, I'm not sure why please explain the cause of this error and the correction required, Thanks in advance!
Jan 31 '15 #1
1 1325
weaknessforcats
9,208 Expert Mod 8TB
It looks like line 9 does not end in a semi-colon.
Jan 31 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: mandogon | last post by:
Hello peoples i am having trouble compiling this program getting a the error is "Declaration Syntax error" using borland c++ bulider v.6 if any one can help thanks void __fastcall...
2
by: Michael Shaw | last post by:
Environment: WinXP Pro ActivePerl Install Dir: C:\Program Files\perl Trying to use C:\Program Files\perl\lib\Text\ParseWords.pm Command Line: perl -w try.pl < ServerFile Code:
5
DanielTNBaker
by: DanielTNBaker | last post by:
Basically gettting a "Declaration Syntax Error" do not understand what i have done wrong would appreciate it if someone could help. void Search_Client(void); void PriceList(void); void...
2
by: Lothsfeld | last post by:
Can someone help me w/ this I can't run it and I keep getting errors unable to open include file 'stdio.h' and declaration syntax error #include<stdio.h> main(); { int a,b,c; ...
7
by: Bowzer1999 | last post by:
I am a beginner at C++ and would be very grateful if someone could simply tell me why my program will not compile. My program is as follows, #include <stdio.h> #define int 1ST VALUE = 23.0 ...
11
by: Blondie1966 | last post by:
Im trying to write a program about a truck inventory with trucks coming and going and the amount in each one, but keep coming up with declaration syntax error.. Any help would be greatly appreciated....
7
by: ucu13 | last post by:
i have this code: //implementarea clasei Proces #ifndef RTProces.CPP #define RTProces.CPP #include<dos.h> #include"RTproces.h" extern int p;
1
by: akhilandrews | last post by:
void main() { clrscr(); cout<<"\t\tMenu"; cout<<"\n\n\t1.\tDisplay all the employees' info."; cout<<"\n\n\t2.\tDisplay specific employes' info."; ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.