Untitled

mail@pastecode.io avatar
unknown
c_cpp
12 days ago
613 B
0
Indexable
Never
#include <iostream>

void printEvenIndexedLetters( char** words, int wordCount )
{
    for( int i = 0; i < wordCount; ++i )
    {
        char* word = words[ i ];
        for( int j = 0; word[ j ] > 0; ++j )
        {
            if( j % 2 == 0 )
            {
                std::cout << word[ j ];
            }
        }
        std::cout << '\n';
    }
}

int main()
{
    const int wordCount = 3;
    char* words[ wordCount ] = {
            ( char* )"Example", ( char* )"Function", ( char* )"CharArray"
    };

    printEvenIndexedLetters( words, wordCount );

    return 0;
}
Leave a Comment