Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » !!help!!
!!help!! [message #62790] Sat, 22 February 2003 14:19 Go to next message
Eclipse UserFriend
Originally posted by: dzhang79.hotmail.com

i wrote a hello wolrd program to test out cdt...i got some wired result

************************
#include <iostream.h>
#include<string.h>

int main(){
char buff[128];
cout<<"Hello World in CDT haaha!\n";
cin >>buff;
cout<<strlen(buff);
cout<<buff;
return(0);
}
***********************
when i build the program, it always gives me "no newline at end of file"
which there is no newline anyway... couldn't figure it out why!

is iostream.h is deprecate? if it is... then which library should i use
instead of iostream.

thanks for any help!!
Re: !!help!! [message #62806 is a reply to message #62790] Sun, 23 February 2003 10:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ewan_benson.yahoo.com

On Sat, 22 Feb 2003 14:19:36 -0500, Danny wrote:

> i wrote a hello wolrd program to test out cdt...i got some wired result
>
> ************************
> #include <iostream.h>
> #include<string.h>

<rest of program snipped>

Not sure about your first problem, but in answer to your second, I think
your compiler is telling you that the preferred option for inclusion of
iostream is:

#include <iostream>

using namespace std;


Check out any new(ish) C++ tutorial for details.

> ***********************
> when i build the program, it always gives me "no newline at end of file"
> which there is no newline anyway... couldn't figure it out why!
>
> is iostream.h is deprecate? if it is... then which library should i use
> instead of iostream.
>
> thanks for any help!!

Cheers

Ewan
Re: !!help!! [message #62822 is a reply to message #62806] Sun, 23 February 2003 12:24 Go to previous messageGo to next message
Eclipse UserFriend
"Ewan Benson" <ewan_benson@yahoo.com> wrote in message
news:b3aodg$agb$1@rogue.oti.com...
> On Sat, 22 Feb 2003 14:19:36 -0500, Danny wrote:
>
> > i wrote a hello wolrd program to test out cdt...i got some wired
result
> >
> > ************************
> > #include <iostream.h>
> > #include<string.h>
>
> <rest of program snipped>
>
> Not sure about your first problem, but in answer to your second, I
think
> your compiler is telling you that the preferred option for inclusion
of
> iostream is:
>
> #include <iostream>
>
> using namespace std;
>
>
> Check out any new(ish) C++ tutorial for details.

And ignore the fact that the Eclipse CDT User FAQ has such non-standard
includes in it's example as well...tsk tsk. :)
Re: !!help!! [message #63043 is a reply to message #62790] Mon, 24 February 2003 02:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johan.nosp.m.appeal.se

Eclipse bug 26639 is about the newline warning. You can CC yourself at:

http://bugs.eclipse.org/bugs/show_bug.cgi?id=26639

.... in case you are interested.

Cheers //Johan

Danny wrote:
> i wrote a hello wolrd program to test out cdt...i got some wired result
>
> ************************
> #include <iostream.h>
> #include<string.h>
>
> int main(){
> char buff[128];
> cout<<"Hello World in CDT haaha!\n";
> cin >>buff;
> cout<<strlen(buff);
> cout<<buff;
> return(0);
> }
> ***********************
> when i build the program, it always gives me "no newline at end of file"
> which there is no newline anyway... couldn't figure it out why!
>
> is iostream.h is deprecate? if it is... then which library should i use
> instead of iostream.
>
> thanks for any help!!
>
Re: !!help!! [message #63051 is a reply to message #62790] Mon, 24 February 2003 05:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gregory.ewing.qualipse.fr

For the first problem : simply add a newline (just one) at the end of your
code (after the curly brackets) and the re-compile - it should work.

"Danny" <dzhang79@hotmail.com> a
Re: !!help!! [message #63462 is a reply to message #62790] Mon, 03 March 2003 02:55 Go to previous message
Eclipse UserFriend
Danny schrieb:
> i wrote a hello wolrd program to test out cdt...i got some wired result
>
> ************************
> ......

> }

put a new empty line at the the end of the file, like
--------
.....
code
code
code
}
<empty line here>
--------

> when i build the program, it always gives me "no newline at end of file"
> which there is no newline anyway... couldn't figure it out why!
>
> is iostream.h is deprecate? if it is... then which library should i use
> instead of iostream.

use the new headers which are the same name but without the .h

#include <iostream>
#include <string>


> thanks for any help!!
>

hriedel
Previous Topic:Eclipse hangs while building a CPP program
Next Topic:start eclipse ?
Goto Forum:
  


Current Time: Wed Apr 16 10:39:31 EDT 2025

Powered by FUDForum. Page generated in 0.03123 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top