Помощь - Поиск - Пользователи - Календарь
Полная версия: Программа вылетает с ошибкой.
Форум «Всё о Паскале» > Современный Паскаль и другие языки > Ада и другие языки
zloy_pes
Помогите пожалуйста найти ошибку. Программа выдает ошибку (General Protection fault), если ввожу более 4 символов.
void main(){char *s;gets(s);
for(int i=0;s[i];i++){printf("%c",s[i]);}}
Заранее Спасибо.
volvo
Правильно... Ты отводишь место под указатель на строку, sizeof которого = 4... Выдели буфер:

int main() {  // Стандарт требует int
  char s[50]; gets(s);
  for(int i=0;s[i];i++){printf("%c",s[i]);}

  return 0; // И это тоже - требование Стандарта
}
zloy_pes
Оу... Спасибо... Не учел.
hydroxychloroquine over the coun
Amoxicillin Clavulanate 125 Tab Price
where to buy cialis online safel
Cephalexin Dosing Instructions
where to buy zithromax over the
Vip Transactions
nishaknapp
Why not settling on games that is fun and at the same time your earning. Well itll make suspense because of the game as well but dude just try it and it gave me hope while pandemic is real rn. When is the Best Time to Play?
Это текстовая версия — только основной контент. Для просмотра полной версии этой страницы, пожалуйста, нажмите сюда.