When I compile the following:
printf("%*s",lengths[i],row[i]);
I get this warning:
4.0.c:407: warning: field width should have type ‘int’, but argument 2 has type
‘long unsigned int’
lengths is declared as: unsigned long *lengths;.
I tried to solve the problem but to no avail. Adding this,
printf("%*lu",(unsigned long)lengths[i],row[i]);
I get no more warnings but the code doesn't work as it should.
Thank you Vera
Cast it to an int:
printf("%*s", (int) lengths[i], row[i]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With