Hola amigos, estoy usando memoria dinamica y la obtengo bien pero lo que intento es poner toda esa memoria a 0 y lo hago usando memset.
Código PHP:
TAbsPicture *CurrentImage;
TVRLabel **pVRLabel = 0;
TVRBand **pVRBand = 0;
TVRPage **pVRPage = 0;
AnsiString **rutas = 0;
AnsiString **rutasDivisiones = 0;
//Obtengo memoria para los elementos necesarios
rutas = new(nothrow) AnsiString*[nSeleccionadas];
rutasDivisiones = new(nothrow) AnsiString*[nTotalDivisiones];
pVRLabel = new(nothrow) TVRLabel*[nSeleccionadas];
pVRBand = new(nothrow) TVRBand*[nSeleccionadas];
pVRPage = new(nothrow) TVRPage*[nSeleccionadas];
//Limpio todo lo necesario
memset(rutas, 0, sizeof(rutas));
memset(rutasDivisiones, 0, sizeof(rutasDivisiones));
memset(pVRLabel, 0, sizeof(pVRLabel));
memset(pVRBand, 0, sizeof(pVRBand));
memset(pVRPage, 0, sizeof(pVRPage));
El caso es que no se como hacerlo ya que como lo tengo solo limpio 4 bytes y no es lo que quiero.
Luego he probado ha hacer esto:
Código PHP:
memset(rutas, 0, sizeof(rutas)*nSeleccionadas);
memset(rutasDivisiones, 0, sizeof(rutasDivisiones)*nTotalDivisiones);
memset(pVRLabel, 0, sizeof(pVRLabel)*nSeleccionadas);
memset(pVRBand, 0, sizeof(pVRBand)*nSeleccionadas);
memset(pVRPage, 0, sizeof(pVRPage)*nSeleccionadas);
Pero no se si lo hago bien o estoy poniendo a 0 lo que no debo ¿podeis indicarme como hacerlo?