4 Haziran 2017 Pazar

C++ Stringi Pointerla Tersten Yazdırma

#include < QCoreApplication>
#include< stdio.h>
 

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    void ters(const char  * const );
    char cumle[80];
    printf("Metin Giriniz \n");
    gets(cumle);
    printf("\n\nGirilen Metin Tersten Yazildiginda: \n\n");

    ters(cumle);
    printf("\n\nn");
    return 0;
}
void ters(const char *const sPtr)
{
    if(sPtr[0]=='\0')
    {
        return;                              /* BU KISIM COK ÖNEMLİ ALGORİTMA KISMI */
    } 
    else
    {
        ters(&sPtr[1]);
        putchar(sPtr[0]);
    }
}


Share: