euglug.org

[Eug-lug] OT: C question

작성자

카테고리:



Bob MillerMon Aug 27 14:25:06 PDT 2007

Fred James wrote:

> I need to build a string into a character array (which I know how to 
> do).  But one of the characters needs to be 'Ctrl-T' - any ideas?  Thank 
> you in advance for any help you may be able to offer

    char my_string[] = "Type ? for Tenex";
    my_string[5] = 'T' & 0x1F;

or...

    const char my_string[] = "Two for \x14 and \x14 for two";

Is that what you're looking for?

-- 
Bob Miller                              K<bob>
                                        kbob at jogger-egg.com