Skip to main content
cjaya.1
Associate III
January 9, 2023
Question

I have a two dimensional array char as str[2][10].

  • January 9, 2023
  • 1 reply
  • 768 views
 I have assigned the string into the char array as "example\n". How do I put the "\n" character in front of the "example\n". I wanted like this "\nexample\n" on the char array

    This topic has been closed for replies.

    1 reply

    Karl Yamashita
    Principal
    January 10, 2023
    #include "string.h"
     
    memmove(str[0]+1, str[0], strlen(str[0]));
    str[0][0] = '\n';

    If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source