On Thu, 2005-07-28 at 08:40 +0530, Nikhil Karkare wrote:
> Hello,
> I want to install Fedora Core 4. Anyone have DVD/CDs of the same? Also
> does Redhat still ship out their documentation CD? Or was that stopped
> in Fedora?
> 

I have FC3 all 4 discs !!


I am pasting the correct version of both the programs.

#include<iostream.h>

int main()
{
 cout<<"Hello, World";
return(0);
}

Ok, when i compile the above program u should get a warning which is as
below this is concerned with the section 17.4.1.2 so you can refer what
that section says but it's no use

You can just simply ignore it !!


[EMAIL PROTECTED] ~]$ vi 1.cpp
[EMAIL PROTECTED] ~]$ g++ -o 1 1.cpp
In file included from /usr/lib/gcc/i386-redhat-
linux/3.4.2/../../../../include/c++/3.4.2/backward/iostream.h:31,
                 from 1.cpp:1:
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c+
+/3.4.2/backward/backward_warning.h:32:2: warning: #warning This file
includes at least one deprecated or antiquated header. Please consider
using one of the 32 headers found in section 17.4.1.2 of the C++
standard. Examples include substituting the <X> header for the <X.h>
header for C++ includes, or <iostream> instead of the deprecated header
<iostream.h>.

 To disable this warning use -Wno-deprecated.

so i will write the compilation once again

[EMAIL PROTECTED] ~]$ vi 1.cpp
[EMAIL PROTECTED] ~]$ g++ -o 1 1.cpp -Wno-deprecated

Now you want get an error and your program will run satisfactorily
[EMAIL PROTECTED] ~]$./1

Now the Problem with namespaces here goes

#include<iostream>

using namespace std;  // I am using namespace so i can  
                       // remove .h 
int main()
{
 cout<<"Hello, World";
return(0);
}

[EMAIL PROTECTED] ~]$ vi 1.cpp
[EMAIL PROTECTED] ~]$ g++ -o 1 1.cpp
[EMAIL PROTECTED] ~]$ ./1
Hello, [EMAIL PROTECTED] ~]$

I hope this solves your query !
I have tried to explain the best that i can
if you have any more queries you can mail me offlist too

On 7/28/05, Nikhil Karkare <[EMAIL PROTECTED]> wrote:
> Hello,
> I want to install Fedora Core 4. Anyone have DVD/CDs of the same? Also
> does Redhat still ship out their documentation CD? Or was that stopped
> in Fedora?
> 
> Another question I had was I have Fedora Core 1 with g++ 3.2. I am
> trying to compile a simple hello work c++ program using cout.
> When I try #include <iostream>
> The compiler cries that cout isn't declared.
> But when I use #include <iostream.h>, it work fine, but with a
> deprecated warning.
> 
> Here is that program:
> 
> #include <iostream.h> //iostream doesnt work.
> #include <stdlib.h>
> 
> using namespace std;
> 
> int main()
> {
>   cout << "Hello, World!!" << endl; // I also tried std::cout... wouldnt
> work.
> 
>   return 0;
> }
> 
> I read that gcc 2.95 had this issue with namespaces, but that got
> resolved post that. So what is the problem here?
> Any help would be great! Thanks!
> -- 
> -----------------------------------------------------------------------------
> vi vi vi - The Editor of the Beast
> -----------------------------------------------------------------------------
> 
> --
> ______________________________________________________________________
> Pune GNU/Linux Users Group Mailing List:      ([email protected])
> List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
> Send 'help' to [EMAIL PROTECTED] for mailing instructions.
>

--
______________________________________________________________________
Pune GNU/Linux Users Group Mailing List:      ([email protected])
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.

Reply via email to