I was wondering how you put blank spaces in 2-dimensional arrays.
Thanks
I was wondering how you put blank spaces in 2-dimensional arrays.
Thanks
err...
you mean,
Code:char arr[2][2] = { {' ', ' '}, {' ', ' '} };
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
oh ok thanks, I wasn't putting the dashes in because I thought that was only for outputting.
Thanks heaps!!
I just did that but the compiler is saying parse error. I also tried with " " but that doesn't work either.
Any idea why?
Well, that array definition is correct. Copy/paste the bit of your code that is producing the error, please...
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Code:int bankcheque [27][3] = {{" "," "," "," ",_," "," ",_," "," "," "," "," ",_," "," ",_," "," ",_," "," ",_," "," ",_," "," ",_," "}, {" "," ",|," ",_,|," ",_,|,|,_,|,|,_," ",|,_," "," "," ",|,|,_,|,|,_,|,|," ",|}, {" "," ",|,|,_," "," ",_,|," "," ",|," ",_,|,|,_,|," "," ",|,|,_,|," ",_,|,|,_,|} };
Sorry, i know it's long but this is it with the " ".
Wow...
1st. You are declaring your array as int, but feeding it with strings. It's either an array of strings, or an array of ints.
2nd. The compiler doesn't know what the underscores and the pipe characters you have there mean.
3rd. You are defining an array larger that what you declared.
4th. You are missing the ending } and ;
I'm not sure what you want... but maybe you want this:
You need to learn about variable declaration and types. A pair of " (double quotes) is used for delimiting literal strings. A pair of ' (single quotes) is used for delimiting literal chars.Code:char bankcheque[3][30] = { {' ',' ',' ',' ','_',' ',' ','_',' ',' ',' ',' ',' ','_',' ',' ','_',' ',' ','_',' ',' ','_',' ',' ','_',' ',' ','_',' '}, {' ',' ','|',' ','_','|',' ','_','|','|','_','|','|','_',' ','|','_',' ',' ',' ','|','|','_','|','|','_','|','|',' ','|'}, {' ',' ','|','|','_',' ',' ','_','|',' ',' ','|',' ','_','|','|','_','|',' ',' ','|','|','_','|',' ','_','|','|','_','|'} };
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Thankyou soooooo much. Working now. Your help is much apprecaited!