array

how do you save information to an array. i wrote a program to decode a .rle file and now i need to save it to an array but i dont know how. here is the code i have so far
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using namespace std;

int main()
{
	int integer;
	char character;
	char barniearray [100][80];
	
	do
	{
	
		cin >> integer;
		
		
		if (integer> 0)
		{
			cin >> character;
		  
		    for(int N=1;N<=integer; N++)
		  {
			cout << character;
			
			
		  }
        }
        else if (integer ==0)
	  cout << endl;
		
		
	}while (integer>=0);
           

                
						
	return 0;
}
Last edited on
Google arrays
The above code just keeps changing the values of integer and character (and prints character)
Write out the algorithm with pencil and paper. If that makes sense write the pseudo code and then code that. Your question appears to be how do you write a string file to an array and then how do you separate the integer and character content to facilitate further manipulation. Is this correct or not?
Topic archived. No new replies allowed.