Some graphics quotations
1- how i can change backgroud from black to any color.
2- how i can change line color ?
sorry another topic :
3- if i use loop and i want to build string like this:
char *x;
x="$";
for ( int i=1;i<5;i++)
x=x+x;
result like this
$$$$$$$$$$
how i can do that ?
Thanks
[327 byte] By [
Mansur] at [2007-11-11 8:40:22]

# 1 Re: Some graphics quotations
Hi,
as to questions 1/2 that depends on your O/S and compiler. I do not believe you can change the output color in a Windows command prompt on a character-by-character basis but probably somebody else corrects me here.
question 3:
the code fragment above has a few flaws.
1) you do not allocate memory for your string x which causes memory faults
2) you cannot add pointers in the way you do (x + x) is impossible
try to use the STL:
#include <string>
using namespace std;
string f(int len, char c)
{
string reval("");
for(int i = 0; i<len; i++)
{
reval += c;
}
return reval;
}
Careful! you have to fill some gaps...
Cheers,
D