CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    Join Date
    Feb 2009
    Posts
    201

    Program problem - doesn't work.

    Derp
    Last edited by realchamp; April 5th, 2012 at 11:46 AM.

  2. #2
    Join Date
    Apr 2007
    Location
    Mars NASA Station
    Posts
    1,436

    Re: Program problem - doesn't work.

    I think you better post your code here.
    Thanks for your help.

  3. #3
    Join Date
    Feb 2009
    Posts
    201

    Re: Program problem - doesn't work.

    Derp
    Last edited by realchamp; April 5th, 2012 at 11:46 AM.

  4. #4
    Join Date
    Mar 2009
    Location
    Bulgaria
    Posts
    63

    Re: Program problem - doesn't work.

    C:/ or C:\ ?

  5. #5
    Join Date
    Feb 2009
    Posts
    201

    Re: Program problem - doesn't work.

    C:\

    If I changed it to C:\ would it work then?

    Worth a try.


    EDIT: New error with:
    Code:
    srcds_beta.cpp(73) : warning C4129: 's" : unregognized character escape sequence.
    I added \ instead of /
    Last edited by realchamp; March 13th, 2009 at 11:27 AM.

  6. #6
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Program problem - doesn't work.

    Quote Originally Posted by realchamp View Post
    C:\

    If I changed it to C:\ would it work then?

    Worth a try.


    EDIT: New error with:
    Code:
    srcds_beta.cpp(73) : warning C4129: 's" : unregognized character escape sequence.
    I added \ instead of /
    That is because just a single backslash denotes the start of an escape sequence in C++. You need to use two backslashes to represent a literal single backslash.

    Example:
    Code:
    const char *whatever = "c:\\mydirectory\\myfile.txt";
    You even do it in your own code:
    Code:
    cout << "\n";
    What does the single backslash do there?

    Regards,

    Paul McKenzie

  7. #7
    Join Date
    Feb 2009
    Posts
    201

    Re: Program problem - doesn't work.

    Hello, I will try your code there, thanks!

    Well my "\n" creates an empty line.

  8. #8
    Join Date
    Feb 2009
    Posts
    201

    Re: Program problem - doesn't work.

    Well it didn't work. The Hldsinstaller.exe isn't downloaded to the C:\srcds folder.

    Still the same error
    "C:/srcds/Hldsinstaller.exe is not a regognized command(etc)."

  9. #9
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Program problem - doesn't work.

    The Windows command line doesn't like forward slashes in some cases. We've already established that.

  10. #10
    Join Date
    Apr 2004
    Posts
    102

    Re: Program problem - doesn't work.

    For file path names:

    Forward slash '/' is used for Unix, Linux, MacOSX, BSD, etc.

    Backslash '\' is used for Windows (and old MS-DOS).

    In the case of file paths within your strings in your C/C++ files, you need to use '\\' since '\t', '\n', '\0', etc. at an unintended place would goof things up. This applies to ALL your file path slashes, not just the leading one. You need to alter them all.


    (For completeness, ":" was used for MacOS until version X)

  11. #11
    Join Date
    Feb 2009
    Posts
    201

    Re: Program problem - doesn't work.

    This is for Windows.

    Well, when I run my srcds_beta.exe - I get those annoying "Couldn't find c:/srcds/hldsupdatetool.exe". The wget.exe is in there. And I set a command to run that EXE, then it just have to run it there. And safe the downloaded file there. But it doesn't. It downloads it into the same folder where the main program is executed.

  12. #12
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Program problem - doesn't work.

    Quote Originally Posted by realchamp View Post
    Hello, I will try your code there, thanks!
    Please post the code you have now.
    Well my "\n" creates an empty line.
    So ask yourself, why doesn't it print a backslash and the letter 'n'? That was my point, and that was to bring to your attention that backslash characters have special meaning in a string.

    Regards,

    Paul McKenzie

  13. #13
    Join Date
    Feb 2009
    Posts
    201

    Re: Program problem - doesn't work.

    Derp.
    Last edited by realchamp; April 5th, 2012 at 11:46 AM.

  14. #14
    Join Date
    Mar 2009
    Location
    Bulgaria
    Posts
    63

    Re: Program problem - doesn't work.

    "Couldn't find c:/srcds/hldsupdatetool.exe"
    Don't you see you still have some wrong oriented slashes?
    I'm not going to search through the code, it might also be in the .bat file. But... when I said in the beginning "C:/ or C:\ ?" I hoped this will be enough. Be more careful, make your changes, check your code, and then continue asking.

  15. #15
    Join Date
    Feb 2009
    Posts
    201

    Re: Program problem - doesn't work.

    Derp
    Last edited by realchamp; April 5th, 2012 at 11:46 AM.

Page 1 of 2 12 LastLast

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