www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/05/13:17:36

From: Tom <junkyard AT sunholme DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Info help, please!
Date: Mon, 5 Jan 1998 11:59:56 +0000
Organization: None whatsoever
Distribution: world
Message-ID: <ibiJGPA8sMs0IwUz@sunholme.demon.co.uk>
References: <B0000111133 AT plovdiv DOT techno-link DOT com>
NNTP-Posting-Host: sunholme.demon.co.uk
MIME-Version: 1.0
Lines: 47
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <B0000111133 AT plovdiv DOT techno-link DOT com>, Ivo Stoykov
<istoykov AT plovdiv DOT techno-link DOT com> writes
>Hello
>
>I have a (dull for someone) question:
>       What does it mean the term VOID?

When used in conjunction with a function, eg:

        void jim(int fred)

it means the function does not return a value.

When used in the parameter list, eg:

        int sheila(void)

it means the function does not take *any* parameters. Not that under C,
this is different from

        int sheila()

which means that the function takes an unknown number of parameters.
Under C++, however, it has the same meaning as int sheila(void) above.

When used for pointers, it indicates that the pointer has no particular
type. To access data stored at its address, you must use a typecast,
thus. Void pointers are useful, firstly because they can point to any
type of data, and secondly because they can be assigned to any pointer
variable (and vice-versa) without a warning. This is why malloc returns
a void *.

>PS.: Is there a function returning the (DOS) root path? I found few 
>giving information about current dir & drive but not for current 
>root.

If you are looking for the root directory of the current drive, just add
to the drive letter a colon, followed by a backslash "\" or a slash "/"
(which is not a backslash).

If you mean the path the program was invoked from, the first parameter
(argv[0] that is) contains the full pathname of the program. You can use
one of the fnsplit()-type functions, found in dir.h I think, to extract
the drive and path from this.

--Tom
My real e-mail address is tom AT sunholme DOT demon DOT co DOT uk

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019