473,383 Members | 1,868 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,383 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 1324
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."; ...
1
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.