Skip to content

Instantly share code, notes, and snippets.

@juanfal
Created October 31, 2025 12:15
Show Gist options
  • Select an option

  • Save juanfal/dc57f7a23528927a454d61345e97e570 to your computer and use it in GitHub Desktop.

Select an option

Save juanfal/dc57f7a23528927a454d61345e97e570 to your computer and use it in GitHub Desktop.
recursive reading no invert
// 01.recread_b.cpp
// juanfc 2025-10-31
// https://gist.github.com/juanfal/dc57f7a23528927a454d61345e97e570
#include <iostream>
using namespace std;
int main()
{
void recReadPrint();
recReadPrint(); cout << endl;
return 0;
}
void recReadPrint()
{
char c;
if (cin.get(c) and c != '\n') {
cout << c;
recReadPrint();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment