How to use Array and print all values on MPLAB C Compiler? -


i using mplab c18 compiler pic18. problem can't print values though code works 100% on codeblocks. spent more 3 hours googling problem , don't understand what's causing it. how output looks on both compilers.

mplab output

2

codeblocks output

2

100

200

100

code

char somestr[] ="2,0100,0200,0100"; char *pt; int a; pt = strtok (somestr,",");  while (pt != null)  {     = atoi(pt);     printf("%d\n", a);     pt = strtok (null, ","); } 

thank responses, appropriate it. found solution , share it. instead of strtok used strtokpgmram.

final code

char somestr[] ="2,0100,0200,0100"; char *pt; int a; pt = strtokpgmram (somestr,",");  while (pt != null)  {     = atoi(pt);     printf("%d\n", a);     pt = strtokpgmram(null, ","); } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -