CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2009
    Posts
    6

    Angry strcat a char to open a file in C++ MFC environment

    Hello,

    I am using the code below to open a file but for some reason it is not reading anything. The function takes a char * and it complies and runs without error. Just that when I try to see the output it never open the file. Below is the code I wrote:
    Last edited by trasha001; July 8th, 2009 at 10:07 AM. Reason: Already solved

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: strcat a char to open a file in C++ MFC environment

    Please use code tags, so the code you posted is readable.


    I am using the code below to open a file but for some reason it is not reading anything.
    You opened the file for output. Also, where do you read something ?

  3. #3
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: strcat a char to open a file in C++ MFC environment

    Your code is very hard to read/understand.
    The reasons:
    1. you don't use Code tags
    2. you don't put psaces between operands
    3. you place more than one commands/instructions on the same line
    So you style to write code is not good, try to improve it ASAP!
    Victor Nijegorodov

  4. #4
    Join Date
    Jun 2009
    Posts
    6

    Exclamation Re: strcat a char to open a file in C++ MFC environment

    Hello,

    I have updated the code. Please let me know if it is still not readable. I added a few comments to help you.

    Thank you

    Rasha

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: strcat a char to open a file in C++ MFC environment

    Quote Originally Posted by trasha001 View Post
    Hello,

    I have updated the code. Please let me know if it is still not readable.
    WEll, your code is still not readable enough...
    It is because you only did what p.3 told you.
    How about pp. 1 and 2?
    FYI:
    http://www.codeguru.com/forum/misc.php?do=bbcode#code
    http://www.codeguru.com/forum/announcement.php?f=7
    Last edited by VictorN; July 8th, 2009 at 02:24 AM.
    Victor Nijegorodov

  6. #6
    Join Date
    Jun 2009
    Posts
    6

    Re: strcat a char to open a file in C++ MFC environment

    Solved it, thank you for your help.

  7. #7
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: strcat a char to open a file in C++ MFC environment

    The fact you have solved your problem does NOT mean you may remove the source code(where the problem was) from your OP!
    Without that code al your thread does not make any sense!

    Please, restore your original code and share your solution.
    Victor Nijegorodov

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured