This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to declare a string

I have a list of characters and trying to put them in a string.

char line[13]; /* Line buffer */

NRF_LOG_INFO("Playlist : %c", line[0]); this works displaying 1 character at a time

NRF_LOG_INFO("Playlist : %s", line); does not work displaying the 13 character as a string

What I am needing to do is create an array that has about 1000 x string(char(13)) and be able to read it back.

none of the string functions work I assume these are more c++

Thanks

  • That is strange. Could you try to do the same in a really simple example, E.g. add those lines to examples\peripheral\temperature and check if the result is similar. If it still doesn't work, could you try to build the example using another compiler/IDE. E.g. try opening \examples\peripheral\temperature\pca10056\blank\armgcc and run these commands:

    • make
    • make flash

    Open Termite and check the result.

Related