[Csnd] printf again
| Date | 2011-10-13 12:32 | 
| From | k_o_m_p  | 
| Subject | [Csnd] printf again | 
| 
    
  
    Again the problem with printf: I get this error when I try o run
    this csd file - which I think should work fine: PERF ERROR in instr 1: printf: invalid format string printf "%n%n%d" ktrig krand note aborted I'm not sure if John is working on it, or not. There is no difference putting the string as a variable like this: Sstr = "%n%n%d" printf Sstr, ktrig, krand Thanks for any help. Luis <CsoundSynthesizer> <CsOptions> -odac -d -m0 </CsOptions> <CsInstruments> instr 1 krand randh 1, 1 ktrig = abs(krand) printf "%n%n%d", ktrig, krand endin </CsInstruments> <CsScore> i1 0 20 e </CsScore> </CsoundSynthesizer>  | 
| Date | 2011-10-13 12:37 | 
| From | jpff@cs.bath.ac.uk | 
| Subject | Re: [Csnd] printf again | 
What do you expect it to do? %n is not anything I recpognoise and there are 3 % args and only 2 values. > Again the problem with printf: I get this error > when I try o run this csd file - which I think > should work fine: > > PERF ERROR in instr 1: printf: invalid format string > printf "%n%n%d" ktrig krand > note aborted > > I'm not sure if John is working on it, or not. > There is no difference putting the string as a > variable like this: > > Sstr = "%n%n%d" > printf Sstr, ktrig, krand > > Thanks for any help. > > Luis > >  | 
| Date | 2011-10-13 12:40 | 
| From | Sigurd Saue  | 
| Subject | Re: [Csnd] printf again | 
| 
    
  
    Maybe this is the format string you intend: "%d %d /n" ? Sigurd Den 13.10.2011 13:32, skrev k_o_m_p: Again the problem with printf: I get this error when I try o run this csd file - which I think should work fine:  | 
| Date | 2011-10-13 12:52 | 
| From | k_o_m_p  | 
| Subject | Re: [Csnd] printf again | 
| 
    
  
    Ah! OK, I was not aware that printf doesn't recognize %n has new
    line like the prints opcode. So new line with printf is \n like in
    C. OK. I think it could be nice to have it mentioned on the manual, since prints and printf use different arguments. Thanks. Luis Em 13.10.11 13:37, jpff@cs.bath.ac.uk escreveu: What do you expect it to do? %n is not anything I recpognoise and there are 3 % args and only 2 values. --  
  Severinswall 54 D-50678 Köln http://luisantunespena.eu +49 (0)221 29020757 +49 (0)176 968 09 867 (mobile)  | 
| Date | 2011-10-13 12:58 | 
| From | Sigurd Saue  | 
| Subject | Re: [Csnd] printf again | 
| 
    
  
    Wrong slash, should be "%d %d \n" Den 13.10.2011 13:40, skrev Sigurd Saue: Maybe this is the format string you intend: "%d %d /n" ?  |