Article View: es.comp.os.linux.programacion
Article #18126Segmentation fault por falta de argumentos
From: Ozone
Date: Mon, 27 Sep 1999 00:00
Date: Mon, 27 Sep 1999 00:00
23 lines
1189 bytes
1189 bytes
cuando hago esto:
int main( int argc, char **argv )
{
Y no paso argumentos al programa se supone que argc deber�a estar en cero
�No?
bueno pues si contin�o con algo como:
if( argc > 0 )
c = atoi( argv[1] );
deber�a funcionar �no?
bueno, pues hice un programa parecido, y sin embargo no funciona. Si no le
paso argumentos se cae y me dice "segmentation fault: core dumped" y obtengo
un archivo "core"
con gdb pude ver que argc no se est� poniendo en cero si no en algo como
15393848(un n�mero muy grande) y no entiendo porqu�.
Ayuda!
Technical Details
Message-ID:
<7t61lr$hdv$1@batcher.rediris.es>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,93ab638515be0660,start X-Google-Attributes: gidf86c8,public From: "Ozone" <ozone@mailcc.com> Subject: Segmentation fault por falta de argumentos Date: 1999/09/27 Message-ID: <7t61lr$hdv$1@batcher.rediris.es> X-Deja-AN: 532131530 Distribution: es X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 X-Complaints-To: newsmanager@rediris.es X-Trace: batcher.rediris.es 938904059 17855 206.114.23.83 (2 Oct 1999 22:40:59 GMT) Organization: RedIRIS. NNTP-Posting-Date: 2 Oct 1999 22:40:59 GMT Newsgroups: es.comp.os.linux.programacion