C
Carramba
Hello again!
I'm struggling with adjustment of print out table
I would like to have some thing like this execpt with right ajustment:
var1 some_var v next_var
_________________________________________
2 3 4 23.32
simple approach
#include <stdio.h>
#include <stdlib.h>
int main(void){
printf("%s\t%6s\t%6s\t%6s\n",
"var","next_var","v","more_v");
printf("%d\t%6.2f\t%6d\t%6.2f\t\n", 1333,96.00,11,0.12);
return 0;
}
/*output*/
var next_var v more_v
1333 96.00 11 0.12
dosn't work because I don't know in advance how large those variables
will by...
how would it by possible to make table for printout with fixed with
columns, and let header as well values to by right adjusted?
Thank you in advance!
I'm struggling with adjustment of print out table
I would like to have some thing like this execpt with right ajustment:
var1 some_var v next_var
_________________________________________
2 3 4 23.32
simple approach
#include <stdio.h>
#include <stdlib.h>
int main(void){
printf("%s\t%6s\t%6s\t%6s\n",
"var","next_var","v","more_v");
printf("%d\t%6.2f\t%6d\t%6.2f\t\n", 1333,96.00,11,0.12);
return 0;
}
/*output*/
var next_var v more_v
1333 96.00 11 0.12
dosn't work because I don't know in advance how large those variables
will by...
how would it by possible to make table for printout with fixed with
columns, and let header as well values to by right adjusted?
Thank you in advance!