print Pattern function that handles parameter as string

Need help!! How to write a printPattern() function?

The function takes in a parameter i.e. a char pointer. It handles the parameter as a Cstyle string i.e. a NULL terminated char array. It does not make use of the stringclass or its associated functions. In other words, the function examines every char element in the array until it encounters the terminating NULL character.

Starting from this int main :

int main() {
char string1[] = "Application of C++";
printPattern(string1);
}

output should be something like this :

A
Ap
App
Appl
Appli
Applic
Applica
Applicat
Applicati
Applicatio
Application
Application
Application o
Application of
Application of
Application of C
Application of C+
Application of C++
Last edited on
There are multiple problems with the assignment itself, but I am going to ignore that.

Have you ever made the triangle star program? What have you written so far for this assignment?
Topic archived. No new replies allowed.