it would've solved his problem of getting the loop done--feel free to make your 
own suggestion. strlen isn't extremely costly to run, or we wouldn't have it. 
Granted, he could just incriment a pointer and check to see if it's null in the 
loop, but the for loop was an easier approach.



Thanks,
Tyler Littlefield
email: [EMAIL PROTECTED]
web: tysdomain-com
Visit for quality software and web design.
skype: st8amnd2005

  ----- Original Message ----- 
  From: Thomas Hruska 
  To: [email protected] 
  Sent: Saturday, November 08, 2008 6:44 AM
  Subject: Re: [c-prog] Re: Command line parameters


  Tyler Littlefield wrote:
  > you need to assign a pointer to it like:
  > char*i=argv[2];
  > then do something like:
  > for (int counter=0;counter<strlen(i);counter++)
  > {
  > if (foo(i[counter]))
  > ...
  > etc. Code may be a bit messy, I'm still half asleep.
  > 
  > Thanks,
  > Tyler Littlefield
  > email: [EMAIL PROTECTED]
  > web: tysdomain-com
  > Visit for quality software and web design.
  > skype: st8amnd2005

  Performance unfriendly approach (not noticeable in this case, but we 
  don't want to be teaching people bad habits this early on) and 
  completely unnecessary.

  -- 
  Thomas Hruska
  CubicleSoft President
  Ph: 517-803-4197

  *NEW* MyTaskFocus 1.1
  Get on task. Stay on task.

  http://www.CubicleSoft.com/MyTaskFocus/



   

[Non-text portions of this message have been removed]

Reply via email to