C++/Function/Function Recursion — различия между версиями

Материал из C\C++ эксперт
Перейти к: навигация, поиск
м (1 версия: Импорт контента...)
 
(нет различий)

Текущая версия на 10:27, 25 мая 2010

Principle of recursion by a function

#include <iostream>
using namespace std;
void getput(void);
int main()
{
   cout << "Please enter a line of text:\n";
   getput();
   cout << "\nBye bye!" << endl;
   return 0;
}
void getput()
{
   char c;
   if( cin.get(c)  &&  c != "\n")
      getput();
   cout.put(c);
}