here is my code
Code:
#include <stdio.h>
#define MAX 81
void substring(char *n,int i,int j)
{int k;
char substr[MAX];
for(k=0;k<=j;k++)
{
printf("%c",*(n+i+k));
*substr=*(n+k+i);
substr++;
}
*substr='\0';
printf("%s",substr);
}
int main(void)
{
char name[MAX]; /* allot space */
printf("Hi, what's your name?\n");
gets(name); /* place string into name array */
printf("Nice name, %s.\n", name);
substring(name,2,1);
return 0;
}
its giving an error "error: wrong type argument to increment"
i think i am doing right but still getting error .please someone suggest something