Message: Re: G4cout weird behaviour Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Re: G4cout weird behaviour 

Forum: Documentation and Examples
Re: Question G4cout weird behaviour (Hans Wenzel)
Re: More Re: G4cout weird behaviour (Krisztian Balla)
Re: Idea Re: G4cout weird behaviour (Krisztian Balla)
Date: 31 Jan, 2009
From: Krisztian Balla <Krisztian Balla>

Hans Wenzel wrote:

> Hi Krisztian
> 
> 
> sorry that must have been my mistake cutting and pasting
> 
> changing that to:
>    G4String tagstr2, tagstr = "float ";
>    G4cout << "here we go again: " << G4endl;
>    for (int i = 0; i < 5; i++) {
>        tagstr2 = tagstr + "hcal" + i + ":";
>        tagstr = tagstr2;
>        G4cout << tagstr2 << G4endl;
>    }  we get.
> 
> here we go again:
> float hcal0float hcal0float hcal0float hcal0float hcal0Start Run processing.
> 
> So this is kind of weird e.g. the G4endl statement is not executed
> 
> 
> cheers Hans

Was there also an error when you copy pasted the output? Now there is always 0 instead of 1, 2, 3 ... after the "hcal" string you print out.

I haven't executed this code yet. Did you try removing the integer?

I guess that G4endl is simply a define for a string containing ASCII 10 (on Linux) or ASCII 13 & 10 (on Windows) or ASCII 13 (on Mac).

What operating system are you using?

 Add Message Add Message
to: "Re: G4cout weird behaviour"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]