2 Replies - 461 Views - Last Post: 30 December 2011 - 09:13 AM Rate Topic: -----

#1 EvLSnoopY  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 93
  • Joined: 24-November 09

Dynamic printf()

Posted 30 December 2011 - 07:32 AM

Is there anyway to make the digit next to the "s" dynamic in the following code?
I've tried to do something like "%-%i%s" out of desperation but of course that didn't work.
Any help will be appreciated. Thanks!
printf("%-1s %1s\n", "|", "|");


Is This A Good Question/Topic? 0
  • +

Replies To: Dynamic printf()

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6039
  • View blog
  • Posts: 23,437
  • Joined: 23-August 08

Re: Dynamic printf()

Posted 30 December 2011 - 07:41 AM

Goto this page and search the text for dynamic.
Was This Post Helpful? 1
  • +
  • -

#3 EvLSnoopY  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 93
  • Joined: 24-November 09

Re: Dynamic printf()

Posted 30 December 2011 - 09:13 AM

Thank you very much Jack this is just what I needed. +1
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1