Announcement

Collapse
No announcement yet.

C help: how do I use a string to specify a filename?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    I don't know how to more simply put an integer into a string than by sprintf, and I don't know what you mean by saying "just initialize such strings"
    12-17-10 Mohamed Bouazizi NEVER FORGET
    Stadtluft Macht Frei
    Killing it is the new killing it
    Ultima Ratio Regum

    Comment


    • #17
      Typecast the integer into a string and use strcat should do the trick.
      (\__/) 07/07/1937 - Never forget
      (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
      (")_(") "Starting the fire from within."

      Comment


      • #18
        itoa is not included in the stdlib.h of gcc

        If you attempt to call it, it returns a compilation error about it being undefined
        12-17-10 Mohamed Bouazizi NEVER FORGET
        Stadtluft Macht Frei
        Killing it is the new killing it
        Ultima Ratio Regum

        Comment


        • #19
          Originally posted by KrazyHorse
          I don't know how to more simply put an integer into a string than by sprintf, and I don't know what you mean by saying "just initialize such strings"
          oh yea, you'd have to modify the initialized string still doable in a rube goldbergesque way.

          Comment

          Working...
          X