replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Problem with Plato (C++)
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with Plato (C++)

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
KL



Joined: 16 Nov 2009
Posts: 155

PostPosted: Sun Jul 10, 2011 3:23 pm    Post subject: Problem with Plato (C++) Reply with quote

I have tried to run some beginners C++ programs with Plato (latest build). All tests ran successfully with Visual C++ Express 2010. However, when I run the programs employing Plato, I get always only one line of output. For instance
Code:

 #include <iostream.h>

 int main()
 {
    cout << "Hello World!\n";
    cout << "Hello World!\n";
    cout << "Hello World!\n";
    cout << "Hello World!\n";
    cout << "Hello World!\n";
    return 0;
 }


gives (only one Hello World!):
Code:

Hello World!

Press RETURN to close window ...


Can anybody help? Many thanks,

Klaus
Back to top
View user's profile Send private message
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Mon Jul 11, 2011 10:59 pm    Post subject: Reply with quote

It looks like it is outputting all the lines, just they are on top of each other.

In Windows you may need to use the following to ensure a "LF" linefeed is output as well as a "CR" carriage return.

cout << "Hello World!\r\n";

or use the following, which is better.

cout << "Hello World!" << endl;
_________________
Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8208
Location: Salford, UK

PostPosted: Tue Jul 12, 2011 6:01 am    Post subject: Reply with quote

This looks to me like a bug in the ostream library (within salflibc.dll).
A fail flag is being set after the endl and this causes subsequent output to be lost.

I am working on a fix.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8208
Location: Salford, UK

PostPosted: Tue Jul 12, 2011 12:02 pm    Post subject: Reply with quote

I have fixed this bug in salflibc.dll for the next release.
Back to top
View user's profile Send private message AIM Address
KL



Joined: 16 Nov 2009
Posts: 155

PostPosted: Tue Jul 12, 2011 12:31 pm    Post subject: Reply with quote

Thank you very much, Paul.

Klaus
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group