[Newbie Programming] How to increase/increment the size of a string variable..
So I want to create step/waterfall type effect using string.
I have managed to draw a single step. However, everytime the program loops I want it to increase the size of the step.
ie:
Current Code
Code:
#include <iostream>#include <string>
using namespace std;
int main()
{
// A prompting message to user
cout << "How many steps you wish to draw: ";
int steps; // Variable that stores the amount of steps
cin >> steps; // stores users given value
// The loop runs depending on the user value
for(int i = 0; i < steps; i++)
{
// This is the normal length of a step
string nstep = "*";
// Draws the step
cout << nstep + "*" << endl;
}
int x;
cin >> x;
return 0;
}
Current code produces:
How many steps you wish to draw?
5
and it draws: