-4
char AT[2] = "AT";
char AT_COMPLEMENT[4] = "\r\n";

How can I join the two strings in ESP-IDF?

1

1 Answer 1

-4

Actually ESP-IDF uses C, so I fix it with this:

char *AT = "AT"; const char *AT_COMPLEMENT= "\r\n";

char * strcat (char * dest, const char * src)

Sign up to request clarification or add additional context in comments.

3 Comments

You may write your answer in code style.
esp-idf uses C.
Your AT is a pointer to a string array of 3-byte long (including terminating \0), if you strcat(char* dest, const char* src) means strcat(AT, AT_COMPLEMNT), you will have an overflow on AT array, if may not crash immediately, but it will sooner or later.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.