Article View: es.comp.os.linux.programacion
Article #8721problemas con argumentos
From: quantium
Date: Sun, 20 Oct 2002 13:10
Date: Sun, 20 Oct 2002 13:10
29 lines
1598 bytes
1598 bytes
Buenas.
Tengo un problema a la hora de usar los argumentos con funciones
"caseras". Cuando intento compilar el siguiente programa me da un error,
que es el siguiente:
In function `funcion':
12: `argc' undeclared (first use in this function)
12: (Each undeclared identifier is reported only once
12: for each function it appears in.)
13: `argv' undeclared (first use in this function)
�como podria usar argv[0] y argc usando funcion()?
Muchas gracias a todos y un saludo.
#include <stdio.h>
void funcion(void);
int main(int argc,char *argv[])
{
funcion();
return 0;
}
void funcion(void){
printf("en total tienes %i argumentos\n",argc);
printf("y el programa se llama: %s\n",argv[0]);
}
Technical Details
Message-ID:
<3DB2AB31.8070509@lycos.es>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!62.174.160.139!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f86c8,d35a912851c9a862,start X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2002-10-20 06:10:14 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!62.174.160.139!not-for-mail From: quantium <quantium@lycos.es> Newsgroups: es.comp.os.linux.programacion Subject: problemas con argumentos Date: Sun, 20 Oct 2002 15:10:09 +0200 Lines: 30 Message-ID: <3DB2AB31.8070509@lycos.es> NNTP-Posting-Host: 62.174.160.139 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fu-berlin.de 1035119410 26855088 62.174.160.139 (16 [129971]) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc3) Gecko/20020523 X-Accept-Language: en-us, en