Returning a CHAR[] from a function
- From: "Tim" <tnorton@xxxxxxxxxxx>
- Date: 26 Aug 2006 15:38:04 -0700
I have the following function that returns the path of where the
program was run from.
However I cant seem to return the butter as a CHAR. The code works if I
use it in a procedure but not where I need to return the variable CHAR
buffer.
char CAutoRunDlg::GetProgramPath(void)
{
char buffer[_MAX_PATH]; //declares maimum path
//opens window maximized
//_getcwd(,)gets the current working directory
// #include <direct.h> //needed for current working directory
/* Get the current working directory: */
if( _getcwd( buffer, _MAX_PATH ) == NULL )
perror( "_getcwd error" );
else
printf( "%s\n", buffer );
return buffer;
}
.
- Follow-Ups:
- Re: Returning a CHAR[] from a function
- From: Tom Serface
- Re: Returning a CHAR[] from a function
- From: Vipin
- Re: Returning a CHAR[] from a function
- From: Pete Delgado
- Re: Returning a CHAR[] from a function
- From: David Wilkinson
- Re: Returning a CHAR[] from a function
- Prev by Date: Re: ctrl + click multiple windows
- Next by Date: Re: Returning a CHAR[] from a function
- Previous by thread: File erasing
- Next by thread: Re: Returning a CHAR[] from a function
- Index(es):
Loading