-
March 12th, 2009, 03:47 PM
#1
Program problem - doesn't work.
Last edited by realchamp; April 5th, 2012 at 11:46 AM.
-
March 13th, 2009, 04:54 AM
#2
Re: Program problem - doesn't work.
I think you better post your code here.
Thanks for your help.
-
March 13th, 2009, 09:12 AM
#3
Re: Program problem - doesn't work.
Last edited by realchamp; April 5th, 2012 at 11:46 AM.
-
March 13th, 2009, 09:27 AM
#4
Re: Program problem - doesn't work.
-
March 13th, 2009, 11:21 AM
#5
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.
-
March 13th, 2009, 11:33 AM
#6
Re: Program problem - doesn't work.
Originally Posted by realchamp
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:
What does the single backslash do there?
Regards,
Paul McKenzie
-
March 13th, 2009, 04:24 PM
#7
Re: Program problem - doesn't work.
Hello, I will try your code there, thanks!
Well my "\n" creates an empty line.
-
March 13th, 2009, 05:00 PM
#8
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)."
-
March 13th, 2009, 05:03 PM
#9
Re: Program problem - doesn't work.
The Windows command line doesn't like forward slashes in some cases. We've already established that.
-
March 13th, 2009, 05:23 PM
#10
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)
-
March 13th, 2009, 05:59 PM
#11
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.
-
March 13th, 2009, 07:40 PM
#12
Re: Program problem - doesn't work.
Originally Posted by realchamp
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
-
March 13th, 2009, 09:35 PM
#13
Re: Program problem - doesn't work.
Last edited by realchamp; April 5th, 2012 at 11:46 AM.
-
March 14th, 2009, 09:57 AM
#14
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.
-
March 14th, 2009, 02:42 PM
#15
Re: Program problem - doesn't work.
Last edited by realchamp; April 5th, 2012 at 11:46 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|