Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8110193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:39:43+00:00 2026-06-06T01:39:43+00:00

Today, after Slackware 13.37 installation, i’ve got the problem: default GCC 4.5.2 cannot compile

  • 0

Today, after Slackware 13.37 installation, i’ve got the problem: default GCC 4.5.2 cannot compile my code. Now I study C++ by the Stephen Davis’s book “C++ for dummies” and want to compile this:

#include <stdio.h>
#include <iostream.h>

int main(int nNumberofArgs, char* pszArgs[])
{

int nNCelsius;
cout << "Celsisus: ";
cin >> nNCelsius;

int nNFactor;
nNFactor = 212 - 32;

int nFahrenheit;
nFahrenheit = nNFactor * nNCelsius / 100 + 32;

cout << "Fahrenheit: ";
cout << nFahrenheit;

return 0;
}

But my GCC 4.5.2 gives these errors:

FahTCel.cpp:7:14: error: expected ')' before ';' token
FahTCel.cpp:7:14: error: 'main' declared as function returning a function
FahTCel.cpp:8:1: error: 'cout' does not name a type
FahTCel.cpp:9:1: error: 'cin' does not name a type
FahTCel.cpp:12:1: error: 'nNFactor' does not name a type
FahTCel.cpp:15:1: error: 'nFahrenheit' does not name a type
FahTCel.cpp:17:1: error: 'cout' does not name a type
FahTCel.cpp:18:1: error: 'cout' does not name a type
FahTCel.cpp:20:1: error: expected unqualified-id before 'return'
FahTCel.cpp:21:1: error: expected declaration before '}' token
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:39:44+00:00Added an answer on June 6, 2026 at 1:39 am

    Three errors:

    1. The correct header is <iostream>. This program requires no other headers.

    2. You must either put using namespace std; in the file, or refer to std::cout and std::cin explicitly. Take your pick, plenty of C++ programmers disagree about which of the two options is better. (You could also bring just cin and cout into your namespace, if you wanted.)

    3. The program does not write a line terminator at the end. This will cause the output to “look bad” on most terminals, with the command prompt appearing on the same line as the output. For example:

    Here are the corrections:

    #include <iostream>
    using namespace std;
    int main(int argc, char *argv[])
    {
        ...
        cout << nFahrenheit << '\n';
        ...
    }
    

    Note: It is extremely unusual to see main take parameters with names other than argc and argv. Changing the names just makes it harder for other people to read your code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a performance problem today that showed up after some profiling. Calls to
Today I registered myself on Pinterest.com with my Yahoo account. After registration I got
Hi I have been working on this code today after attempting some of the
I just today stumbled upon the Code Metrics thing, after having used Visual Studio
Got this message today after running bundle update : $ bundle update NOTE: Gem::SourceIndex#all_gems
It's just been one problem after another today. I just deployed to my production
I did a math problem today and first attempted it in Python but after
So I just got asked this at an interview today and after some googling
we did this problem today in math class to kill time after a quiz,
I've installed Aptana 1.5 today but after the install all my SVN projects give

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.