#include <stdio_ext.h>
#include <stdlib.h>
int main()
{
char a[10],c[10];
int i,b;
b=1;
i=0;
printf(": ");
scanf("%s",a);
fflush(stdin);
__fpurge(stdout);
while(i<=10)
{
c[i]=a[i]+b;
i++;
}
printf("%s",c);
return (EXIT_SUCCESS);
}
Так дело в том, я хочу, чтобы напечатать символ с следующим символом в таблице ASCII , но каждый раз, когда я бег это я получить эту ошибку, хотя это, кажется, работает с размером 10:*** Stack smasing обнаружен *** // Попытка печати полукокса
: asdf
*** stack smashing detected ***: /home/polo/Escritorio/ejemplo/dist/Debug/GNU-Linux/ejemplo terminated
bteg� c8�l�#w�@���
RUN FINISHED; Aborted; core dumped; real time: 4s; user: 0ms; system: 0ms
'fflush (stdin);' UB. –
WTF является '__fpurge'? – melpomene