in reply to Re^3: Trouble using a Win32 file path in an array
in thread Trouble using a Win32 file path in an array

On older versions of Windows, it didn't work that way, but you are correct on Win XP.

Honestly, Windows 3.1 is a whole other world. It wasn't even an OS.

Not 100% sure, so prove me wrong if a newer Windows doesn't support "/" as the dir separator. Test code below.

Update: not quite right...

What isn't quite right? You (falsely) make it sound like something I said was wrong.


Test to determine if your Windows supports "/" as the directory separator:

>copy con a.cpp #include <windows.h> #include <stdio.h> int main(int argc, char* argv[]) { if (argc != 2) { fprintf(stderr, "usage: %s filename\n", argv[0]); return 1; } HANDLE file = CreateFile( argv[1], GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ); if (file == INVALID_HANDLE_VALUE) { fputs("An error occured\n", stderr); return 1; } return 0; } >cl a.cpp Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for +80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. a.cpp Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. /out:a.exe a.obj >a .\a.exe >a ./a.exe

Replies are listed 'Best First'.
Re^5: Trouble using a Win32 file path in an array
by Anonymous Monk on Sep 29, 2009 at 05:08 UTC
    ikegami meet Marshall, your long lost brother of the martalec tribe