replace a value in a array!

Hi everyone, im workin on a project require me to declare a line of symbols and replace one of the symbols with another symbols.

for example

if first line of print out
[ ], [ ], [ ], [ ], [ ], [ ]

if i want to start the second line at 2
it'll display a new line

[ ],[ ],[ ],[ ],[ ],[ ]
!!!!!X!!!!!!!X!!!!!!!X!

! = space.

here are my codes, any help would be great cuz im stuck!!!





#include <iostream>

using namespace std;




int total_stalls(int stall, int size)

{


for ( stall = 0; stall < size; stall ++)

cout << "|_| ";




return stall;

}

int use_stall( int pos, int current_size)

{


for (pos = 0; pos <= current_size; pos = pos ++)

{
cout << " X ";
}
return pos;

}


int main()

{

int i = 0;

int user_input;

cout <<" Enter the number of stalls in the restroom( No greater then 20): ";

cin >> user_input;

int stall;




stall = total_stalls( i, user_input);

cout << " " << endl;


int stall_use;

cout << " Which stalls were you like to use: ";


while (cin >> stall_use)



{ total_stalls( i, user_input);


use_stall( stall_use, user_input);

}




system("pause");

return 0;

}

















Last edited on
Topic archived. No new replies allowed.