PDA

View Full Version : Couple of visual c++ questions


Stowelly
05-31-2004, 10:29 PM
is there anyway of stopping the bulid as a kind of emergencey thing if it hangs when building fairly often on my machine and the only way i can exit is by ctrl alt del to close it down and then re-open it.... this is very annoying

also how do you join characters together using variables etc erm best way of explaining it is this code here... doesnt let me use the last paramiter

int Level = 1;

char *file = "level"+ Level +".map";



another thing although not visual c++ specific.... is there a function thatll let me check if a file exists e.g

if (FileExists("level1.map)
{
do something
}

thanks

Jason
06-02-2004, 12:29 AM
you can use some of the C code, something like fopen to check if the file exists...I believe when using fopen it returns a value...something like

if( fopen('blah.txt')==1) { then do this }

but you might check my syntax there for fopen.

The reason your having probs with your string concatination is that you are referenceing a variable Level that is not a string. So that is like trying to do some math there...

//example of concat
String::Concat( S"Hello", S"World");

you should use the concat function to create your string in a temp variable before referencing it....

Jason