Recursive Reverse String Algorithm
The Shortest function to reverse a string.
*/
#include <iostream>
using namespace std;
void ret_str(char* s)
{
if(*s != '\0')
ret_str(s+1);
cout<<*(s);
}
int main()
{
ret_str("born2c0de");
return 0;
}
Artikel Terkait:
Algoritma dan Pemrograman
- Class Inheritance
- OOP Recursive Decent Parsing III
- OOP Recursive Decent Parsing II
- OOP Recursive Decent Parsing I
- Calculate Sequebce by Using Iterative Function
- A Comparison of Sorting Algorithms
- Typical data sequences for testing sorting algorithms
- Quicksort Algorithm
- Vector
- Function to reverse an integer array
- Array
- String Contains function
- RECCURENCE RELATION
- Recursion
- Calculator (C++)
- Recursive Format numbers with commas
- Calling functions with Inline Assembly
- Recursive Function
- Algoritma Menentukan Tahun Kabisat
- Algoritma dan Class Bilangan Prima
- Class Luas Lingkaran dan Volume Bola With Jeliot
- Class Bilangan [Bahasa C++]
- Struktur Perulangan (Lanjutan)
- Struktur Perulangan
Belajar Struktur Data
- Class Inheritance
- Calculator (C++)
- Calling functions with Inline Assembly
- Class Bilangan [Bahasa C++]
- Struktur Data Tree (Pohon)
- Struktur Data Queue (Antrian)
- Struktur Data Stack
- Jawaban Pretest & Post Test Praktikum IV (Struktur Data)
- Laporan Praktikum II Struktur Data
- Laporan Diskusi Minggu II
- Pemrograman Dasar C++
- Abtrak Data Type
Laporan Praktikum Algoritma dan Pemrograman
- Class Inheritance
- OOP Recursive Decent Parsing III
- OOP Recursive Decent Parsing I
- Vector
- Recursion
- Recursive Format numbers with commas
- Calling functions with Inline Assembly
- Recursive Function
- Algoritma Menentukan Tahun Kabisat
- Algoritma dan Class Bilangan Prima
- Class Luas Lingkaran dan Volume Bola With Jeliot
- Struktur Pemilihan
Comments :
0 comments to “Recursion Shortest Function to Reverse a String”
Post a Comment