How to send ctrl+z in C

前端 未结 3 452
渐次进展
渐次进展 2020-12-18 23:50

I\'m working with Arduino.

I want to send Ctrl+z after a string in C. I tried truncating ^Z but that didn\'t work. So how to do th

3条回答
  •  春和景丽
    2020-12-19 00:14

    I hacked this up as I needed similar

    #include 
    #define CTRL(x) (#x[0]-'a'+1)
    int main (void)
    {
        printf("hello");
        printf("%c", CTRL(n));
        printf("%c", CTRL(z));
    }
    

    hope it helps 8)

提交回复
热议问题