CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 4 of 4 FirstFirst 1234
Results 46 to 52 of 52

Thread: File I/O help

  1. #46
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,768

    Re: File I/O help

    I can't for security reasons (the software is for website security).
    However, if the security depends on the secrecy of the algorithm rather than on the secrecy of the key, perhaps it is broken to begin with.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  2. #47
    Join Date
    Jul 2008
    Posts
    27

    Re: File I/O help

    Point taken, but I would rather protect both.

  3. #48
    Join Date
    Jul 2008
    Posts
    27

    Re: File I/O help

    . . . Anyone?

  4. #49
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: File I/O help

    Quote Originally Posted by JasonBB
    . . . Anyone?
    What's the question now? How to copy a string to a buffer?
    Quote Originally Posted by JasonBB
    Basically, I just need to put the string back into the buffer, if that's possible.
    Is that it?
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  5. #50
    Join Date
    Jul 2008
    Posts
    27

    Re: File I/O help

    Basically, in this line:

    Code:
     file_out.write(&buffer[0], x);
    I need to use a string instead of the vector<char>, somehow, but the function cannot take a string. i.e. If you look at the code posted on the previous page, I need a way to do this:

    Code:
     file_out.write(mystring, x);
    I was thinking perhaps there was a way to put the string back into the buffer variable, but I don't know.

  6. #51
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,716

    Re: File I/O help

    write() takes a const char * as the first parameter ... use std::c_str()
    member function:

    Code:
     
    file_out.write(mystring.c_str(), x);

  7. #52
    Join Date
    Jul 2008
    Posts
    27

    Thanks

    I truly thank you guys for helping me out on this. The function seem to be working great-- I am just making some small tweaks to the code to make it fit in better with the rest of the program.

    Once again, thank you.

Page 4 of 4 FirstFirst 1234

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)