set a string

Peter Rice pmr at ebi.ac.uk
Wed Jul 9 14:39:08 UTC 2003


Carole Louis wrote:
> The thing I wanna do does not seem really hard but everything I do does 
> not work.


In C, "AAA" is a string (char*), 'A' is a character (char)

> I just want put the string text 'AAA' in the string called variable2.


       AjPStr   variable2 = NULL ;
       ajStrAssC (&variable2, "AAA") ;

You can also use ajStrAssCI:

       ajStrAssCI (&variable2, "AAA", 3) ;

Note that the length is not checked - the function is there to save time 
running strlen on long strings.

Hope this helps,

Peter




More information about the EMBOSS mailing list