urls and filehandles

This is a discussion on urls and filehandles within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by Junior89 are you trying to get the contents of the file written into a string? I believe ...

  1. #16
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Quote Originally Posted by Junior89
    are you trying to get the contents of the file written into a string?
    I believe I gave you a rather simple solution in the end...

    I had the same question not too long ago and nobody gave me a simple solution so i used this and it worked:

    i think that's right (im not at home right now so i cant check) but it worked for me.
    Only as long as your files don't contain more than 99 characters, and only as long as you don't assume that the result is a NUL-terminated string.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  2. #17
    Registered User
    Join Date
    Nov 2004
    Location
    Pennsylvania
    Posts
    434
    It worked for me because it was for an encryption program and the same program that read the files wrote the files with a 10,000 char limit. Your idea was to copy each of the characters into a string right? That's exactly what my method does.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21