-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of blalock
Sent: Monday, October 23, 2000 2:59 AM
To: c++ dev
Subject: [Dev-C++] A newbie question
I am in class learning C. I am trying to do something, just goofing not
schoolwork, and I wanted to know if I can put a variable in my printf format
string. IE
printf("%variables%5f%3s");
No.
I am trying to make it where I can put spaces into a line but at differing
lengths each time.
You can try #define, #ifdef, #ifndef, e.t.c. in some way but if you want to
create spaces only you can try something like this:
int main()
{
int i=0, spaces=0;
/* spaces are defined somewhere in the code */
for (i=0; i<spaces; i++)
printf(" "); /* It inserts spaces in a line */
...
return 0;
}
If I am misspeaking by asking in this forum, please forgive me. If this is
not a place to ask questions of a general type, could you please direct me
where to go.
It is the right place.
p/s if this is the place for such posts, I have a thousand more :)
Ok post them. :)
Ioannis
* Ioannis Vranos
* Programming pages: http://members.nbci.com/noicys
* Alternative URL: http://run.to/noicys
|