Solved
indexing a array
hi
I want to locate a string in an other string and then mark its position with an 'X'. here is the code
#include "main.h"
#include "adc.h"
#include "dma.h"
#include "i2c.h"
#include "usart.h"
#include "gpio.h"
#include "stm32f1xx.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int position;
char Rcv[500];
char *ret;ret=strstr(Rcv,"+CMTI");
position=ret-Rcv;
Rcv[position]='X';the code doesn't run. when I comment the third line, it works. why is that?