๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #501

Re: Nombre de una funcion

#501
From: |||RIP|||
Date: Sat, 22 Dec 2007 09:42
21 lines
1406 bytes
Pere Pujal i Carabantes escribi๏ฟฝ:

> Holas!
> 
> Cuando se llama a un script bash, $0 nos da el nombre del script.
> 
> Existe algo similar para una funcion en C que nos de el nombre 
> de la funcion?
> 

int main (int argc, char *argv[]) {
.
.
.
}

argc nos da el numero de parametros. Ej: "./programa arg1 arg2",  nos 
daria 3
argv[] nos da el nombre de esos parametros. Ej: argv[0] daria "programa"

Espero que no me haya confundido, suerte!
Technical Details
Message-ID: <P05bj.91129$224.9449@news.ono.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.germany.com!newspeer1.de.telia.net!newspeer4.de.telia.net!de.telia.net!newsf01.ono.com!news.ono.com.POSTED!53ab2750!not-for-mail
References: <slrnfmodjn.v4d.pere@hola.fou.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: f86c8,bb0a650afb4eecda
X-Google-Attributes: gidf86c8,public,usenet
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.germany.com!newspeer1.de.telia.net!newspeer4.de.telia.net!de.telia.net!newsf01.ono.com!news.ono.com.POSTED!53ab2750!not-for-mail
From: |||RIP||| <ripland@gmail.com>
User-Agent: Thunderbird 2.0.0.6 (X11/20070926)
MIME-Version: 1.0
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Nombre de una funcion
References: <slrnfmodjn.v4d.pere@hola.fou.net>
In-Reply-To: <slrnfmodjn.v4d.pere@hola.fou.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 21
Message-ID: <P05bj.91129$224.9449@news.ono.com>
Date: Sat, 22 Dec 2007 10:42:29 +0100
NNTP-Posting-Host: 81.172.101.237
X-Trace: news.ono.com 1198316719 81.172.101.237 (Sat, 22 Dec 2007 10:45:19 MET)
NNTP-Posting-Date: Sat, 22 Dec 2007 10:45:19 MET