реклама на сайте
подробности

 
 
> Задачка со scanf() printf(), взято с http://www.gowrikumar.com/c/
sigmaN
сообщение May 12 2010, 05:26
Сообщение #1


I WANT TO BELIEVE
******

Группа: Свой
Сообщений: 2 617
Регистрация: 9-03-08
Пользователь №: 35 751



What is the differnce between the following function calls to scanf?(Please notice the space carefully in the second call. Try removing it and observe the behaviour of the program)

Код
#include <stdio.h>
  int main()
  {
      char c;
      scanf("%c",&c);
      printf("%c\n",c);

      scanf(" %c",&c);
      printf("%c\n",c);

      return 0;
  }
Почему без пробела не работает? blink.gif


--------------------
The truth is out there...
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 20th July 2025 - 21:46
Рейтинг@Mail.ru


Страница сгенерированна за 0.01353 секунд с 7
ELECTRONIX ©2004-2016