🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Paso de Array bidimensional a funcion

#14184
From: Santiago Romero
Date: Thu, 30 Nov 2000 00:00
44 lines
2113 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

El 30 Nov 2000 11:08:40 GMT, DaVinci escribi�:
>#define MFIL	21
>#define MCOL	13
>
>	for(i = 0; i <= MFIL; i++)
>		for(j = 0; j <= MCOL; j++)
>			matriz[i][j] = 0;

 pero... eso esta mal, no?
 tienes que poner i=0; i<MFIL; i++
 si no, fijate...

 matriz[MFIL] = una matriz que tiene MFIL elementos, es decir, desde 0
                hasta MFIL-1.

 Si pones i<=MFIL (en el bucle for) llegar� un momento en que har�s:

 matriz[MFIL] = 0 <---- escribiendo fuera del sitio! recuerda que
                        como maximo ha de ser MFIL-1

 De hecho, no es obligatorio pasarle el tama�o de una de las dimensiones
 de la matriz como dijiste, tengo montones de codigos que lo pasan
 tal cual (con **) sin problemas.

 salu2!
- -- 
En el manual pon�a "Para Windows2000 o superior", as� que instal� Linux.
 _-----------------------------------------------------_
|  NoP / Compiler    --    compiler@escomposlinux.org   |
|-------------------------------------------------------|
|  POWERED BY - Linux Debian 2.2  -  Reg. User #74.821  |
|  http://www.escomposlinux.org/sromero   ICQ 98602813  |
 ~-----------------------------------------------------~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjomxi8ACgkQx0J/i4MrH+etBgCfXp+GftHnmm5Rp65TihMVOMqv
vXYAnArh4VV+z6Z5pGEWY6rV+hAGRYM9
=12U7
-----END PGP SIGNATURE-----
Technical Details
Message-ID: <fng609.6e.ln@127.0.0.1>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <slrn92cdmg.n1.david@fangorn.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f86c8,c547e3c259865923
X-Google-Attributes: gidf86c8,public
From: sromero@escomposlinux.org (Santiago Romero)
Subject: Re: Paso de Array bidimensional a funcion
Date: 2000/11/30
Message-ID: <fng609.6e.ln@127.0.0.1>
X-Deja-AN: 699679264
Content-Transfer-Encoding: 8bit
References: <slrn92cdmg.n1.david@fangorn.net>
Content-Type: text/plain; charset=iso-8859-1
X-Trace: fu-berlin.de 975620671 143524 62.42.45.133 (16 [39726])
Mime-Version: 1.0
User-Agent: slrn/0.9.6.2 (Linux)
Reply-To: compiler@escomposlinux.org
Newsgroups: es.comp.os.linux.programacion