Hajde daj čitav kod, da vidimo šta tačno radiš…
Ako samo hoćeš da ispišeš koji je karakter na n-tom mestu onda je dovoljno to što ti je Alex rekao.
Code:
char *buff = "String";
printf("%c\n", buff[1]);
Ako pak hoćeš da ga i ukloniš iz stringa onda uradi:
Code:
#include <stdio.h>
#include <string.h>
char *oduzmi(char *s, int mesto)
{
int c, i = 0;
if (mesto < 1) return s;
while (i < mesto) {
c = s[i++];
if (c == '\0') return s;
}
while(s[i] != '\0') {
s[i-1] = s[i];
i++;
}
s[i-1] = '\0';
return s;
}
int main()
{
char *s;
s = (char *) calloc(10, sizeof(char));
strcpy(s, "abcdefghi");
s = oduzmi(s, 4);
printf("%s\n", s);
return 0;
}