๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.lang.learn.c-c++
Article #692

Re: equivalent to app.path (return applications path) ?!??

#692
From: Juan Carrasco
Date: Wed, 03 Nov 1999 00:00
29 lines
2303 bytes
  Normally argv[0] do not have the path of the program, only has the program
name. The C library has a function called "getcwd" that return the current
working directory. Has two parameters, a buffer (char *) and buffer size
(size_t or int). His declaration is "char * getcwd (char * buffer, int
size);".

Jerry Coffin escribi๏ฟฝ en mensaje ...
>In article <7uva69$o6k$1@hiram.io.com>, sean@harvell.com says...
>> Does any one know what the C++ equivalent to Visual Basics app.path is? I
>> would like to return the
>> exact path that the executable is being executed from.
>>
>> Example program being run from:
>> c:\test\mycoolapp.exe
>>
>> Function etc. would return:
>> c:\test
>
>argv[0] is normally the name of your application.  This may or may not
>include a full path, though it probably does more often than not.
>Assuming it's present and has a form that looks like a path on
>whatever system you're running, you can normally separate the name of
>the executable from that path.
>
>--
>    Later,
>    Jerry.
>
>The universe is a figment of its own imagination.
Technical Details
Message-ID: <7voqf4$7ro$1@peque.uv.es>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7uva69$o6k$1@hiram.io.com> <MPG.127ce16189e998b0989757@news.mindspring.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 109fba,66b19b44094781ae
X-Google-Attributes: gid109fba,public
X-Google-Thread: f7a51,66b19b44094781ae
X-Google-Attributes: gidf7a51,public
X-Google-Thread: 114592,66b19b44094781ae
X-Google-Attributes: gid114592,public
X-Google-Thread: f53ec,66b19b44094781ae
X-Google-Attributes: gidf53ec,public
X-Google-Thread: f4307,66b19b44094781ae
X-Google-Attributes: gidf4307,public
X-Google-Thread: 10e4a8,66b19b44094781ae
X-Google-Attributes: gid10e4a8,public
From: "Juan Carrasco" <jcarras@glup.uv.es>
Subject: Re: equivalent to app.path (return applications path) ?!??
Date: 1999/11/03
Message-ID: <7voqf4$7ro$1@peque.uv.es>
X-Deja-AN: 543858973
Distribution: es
References: <7uva69$o6k$1@hiram.io.com> <MPG.127ce16189e998b0989757@news.mindspring.com>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
X-Complaints-To: postmaster@uv.es
X-Trace: peque.uv.es 941616420 8056 147.156.160.4 (3 Nov 1999 08:07:00 GMT)
Organization: Universitat de Valencia
NNTP-Posting-Date: 3 Nov 1999 08:07:00 GMT
Newsgroups: alt.comp.lang.learn.c-c++,comp.lang.c++,es.comp.lenguajes.c++,microsoft.public.vc,microsoft.public.vc.language,nersc.c++