Thread: How to solve this?

  1. #16
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,059
    Quote Originally Posted by fenikkusu View Post
    Thank you all. But I have never heard about this function snprintf(list[i].st,sizeof list[i].st,"C%02d",i+1); Can you clarify it for me?
    snprintf() belongs to the printf() family and instead of writing to the stdout stream it stores its output in the char array specified by its first argument. It is the safer version of sprintf() as the latter can try to store more than can fit inside its first argument. You should make the size of the array char id[] one more than the length of the data to allow for the trailing null.
    Last edited by itCbitC; 01-08-2009 at 11:36 AM.

  2. #17
    Registered User fenikkusu's Avatar
    Join Date
    Jan 2009
    Posts
    12
    ok. Thanks for your explanation. I also googled it and gave it a shot

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can anyone solve this for me? (look inside)
    By johnsonswww in forum C Programming
    Replies: 10
    Last Post: 03-02-2009, 11:24 AM
  2. Replies: 2
    Last Post: 04-25-2005, 11:59 AM
  3. How to handle in software to solve this block diagram?
    By vnrabbit in forum C Programming
    Replies: 4
    Last Post: 02-13-2003, 02:45 PM
  4. Help to solve this problem
    By Romashka in forum C++ Programming
    Replies: 3
    Last Post: 04-16-2002, 09:32 AM