cancel
Showing results for 
Search instead for 
Did you mean: 

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

cjaya.1
Associate II
 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 discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Karl Yamashita
Principal
#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.