begin process at 2012 05 29 18:50:52
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive C/C++

 > 

Archives

 > 

Au secours

 > 

pb de retour( du tableau) de ma fonction


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

pb de retour( du tableau) de ma fonction

mardi 19 août 2003 à 11:54:34 | pb de retour( du tableau) de ma fonction

airwann

bonjour,

j ai un problème comment dois je modifier l'entête de ma fonction pour recupérer le tableau de structure 3 d alloué dynamiquement


merci d avance car je suis à la limite du pétage de plomb

////////////////////////////////////////////////////////////////////

void allocation_image_memoire_buffer_sequence(struct macro *** *image,unsigned int *nbre_picture_startcode_code,unsigned int *composante_horizontal,unsigned int *composante_vertical)
{ unsigned int i,j;
unsigned int *DIMivert,*DIMjhori;
if( (DIMivert=(unsigned int *)calloc(1,sizeof(unsigned int))) == NULL)
{
puts("allocation demandee impossible pour DIMivert\n");
}
if( (DIMjhori=(unsigned int *)calloc(1,sizeof(unsigned int))) == NULL)
{
puts("allocation demandee impossible pour DIMhori\n");
}
DIMivert[0]=0;DIMjhori[0]=0;
puts("allocation_image_memoire_buffer_sequence\n");

if( (*nbre_picture_startcode_code == 0) || (*composante_horizontal == 0)|| (*composante_vertical == 0))
{
exit(1);
puts("probleme de detection\n");
}
*DIMivert=(*composante_vertical)>>4;*DIMjhori=(*composante_horizontal)>>4;
//dimension temporaire
// déclaration des séquences d'images
// allocate space memory for 3D matrix ((buffer sequence d image))
/////////////////////////////////////////////////////////////////////////////////////
image=(struct macro ***)calloc((*nbre_picture_startcode_code), sizeof(struct macro **));

if(!image)
{
puts("\nError making nbreimage image\n");exit(1);
}
for(i = 0 ; i < (*nbre_picture_startcode_code) ; i++)
{
image[i] = (struct macro **)calloc((*DIMivert-1),sizeof(struct macro *));
if(!image[i])
{
puts("\nError making DIMivert2 image\n");exit(1);
}
for(j =0;j<(*DIMivert);j++)
{
image[i][j] = (struct macro *)calloc((*DIMjhori-1),sizeof(struct macro));
if(!image[i][j])
{
puts("\nError making DIMjhori image\n");exit(1);
}
}
}

free(DIMivert);free(DIMjhori);
}

///////////////////////////////////////
mardi 19 août 2003 à 12:06:10 | Re : pb de retour( du tableau) de ma fonction

airwann

j ai essayé ça aussi !!

struct macro ***fonct()
{

return(image);
}
.....



-------------------------------
Réponse au message :
-------------------------------

> bonjour,
>
> j ai un problème comment dois je modifier l'entête de ma fonction pour recupérer le tableau de structure 3 d alloué dynamiquement
>
>
> merci d avance car je suis à la limite du pétage de plomb
>
> ////////////////////////////////////////////////////////////////////
>
> void allocation_image_memoire_buffer_sequence(struct macro *** *image,unsigned int *nbre_picture_startcode_code,unsigned int *composante_horizontal,unsigned int *composante_vertical)
> { unsigned int i,j;
> unsigned int *DIMivert,*DIMjhori;
> if( (DIMivert=(unsigned int *)calloc(1,sizeof(unsigned int))) == NULL)
> {
> puts("allocation demandee impossible pour DIMivert\n");
> }
> if( (DIMjhori=(unsigned int *)calloc(1,sizeof(unsigned int))) == NULL)
> {
> puts("allocation demandee impossible pour DIMhori\n");
> }
> DIMivert[0]=0;DIMjhori[0]=0;
> puts("allocation_image_memoire_buffer_sequence\n");
>
> if( (*nbre_picture_startcode_code == 0) || (*composante_horizontal == 0)|| (*composante_vertical == 0))
> {
> exit(1);
> puts("probleme de detection\n");
> }
> *DIMivert=(*composante_vertical)>>4;*DIMjhori=(*composante_horizontal)>>4;
> //dimension temporaire
> // déclaration des séquences d'images
> // allocate space memory for 3D matrix ((buffer sequence d image))
> /////////////////////////////////////////////////////////////////////////////////////
> image=(struct macro ***)calloc((*nbre_picture_startcode_code), sizeof(struct macro **));
>
> if(!image)
> {
> puts("\nError making nbreimage image\n");exit(1);
> }
> for(i = 0 ; i < (*nbre_picture_startcode_code) ; i++)
> {
> image[i] = (struct macro **)calloc((*DIMivert-1),sizeof(struct macro *));
> if(!image[i])
> {
> puts("\nError making DIMivert2 image\n");exit(1);
> }
> for(j =0;j<(*DIMivert);j++)
> {
> image[i][j] = (struct macro *)calloc((*DIMjhori-1),sizeof(struct macro));
> if(!image[i][j])
> {
> puts("\nError making DIMjhori image\n");exit(1);
> }
> }
> }
>
> free(DIMivert);free(DIMjhori);
> }
>
> ///////////////////////////////////////
mardi 19 août 2003 à 14:55:57 | Re : pb de retour( du tableau) de ma fonction

cbestern

il ne faut pas définir un typedef TypeStruct Structure!!!
comme ça apres tu pourras faire un retour de TypeStruct
enfin je pense



-------------------------------
Réponse au message :
-------------------------------

> j ai essayé ça aussi !!
>
> struct macro ***fonct()
> {
>
> return(image);
> }
> .....
>
>
>
> -------------------------------
> Réponse au message :
> -------------------------------
>
> > bonjour,
> >
> > j ai un problème comment dois je modifier l'entête de ma fonction pour recupérer le tableau de structure 3 d alloué dynamiquement
> >
> >
> > merci d avance car je suis à la limite du pétage de plomb
> >
> > ////////////////////////////////////////////////////////////////////
> >
> > void allocation_image_memoire_buffer_sequence(struct macro *** *image,unsigned int *nbre_picture_startcode_code,unsigned int *composante_horizontal,unsigned int *composante_vertical)
> > { unsigned int i,j;
> > unsigned int *DIMivert,*DIMjhori;
> > if( (DIMivert=(unsigned int *)calloc(1,sizeof(unsigned int))) == NULL)
> > {
> > puts("allocation demandee impossible pour DIMivert\n");
> > }
> > if( (DIMjhori=(unsigned int *)calloc(1,sizeof(unsigned int))) == NULL)
> > {
> > puts("allocation demandee impossible pour DIMhori\n");
> > }
> > DIMivert[0]=0;DIMjhori[0]=0;
> > puts("allocation_image_memoire_buffer_sequence\n");
> >
> > if( (*nbre_picture_startcode_code == 0) || (*composante_horizontal == 0)|| (*composante_vertical == 0))
> > {
> > exit(1);
> > puts("probleme de detection\n");
> > }
> > *DIMivert=(*composante_vertical)>>4;*DIMjhori=(*composante_horizontal)>>4;
> > //dimension temporaire
> > // déclaration des séquences d'images
> > // allocate space memory for 3D matrix ((buffer sequence d image))
> > /////////////////////////////////////////////////////////////////////////////////////
> > image=(struct macro ***)calloc((*nbre_picture_startcode_code), sizeof(struct macro **));
> >
> > if(!image)
> > {
> > puts("\nError making nbreimage image\n");exit(1);
> > }
> > for(i = 0 ; i < (*nbre_picture_startcode_code) ; i++)
> > {
> > image[i] = (struct macro **)calloc((*DIMivert-1),sizeof(struct macro *));
> > if(!image[i])
> > {
> > puts("\nError making DIMivert2 image\n");exit(1);
> > }
> > for(j =0;j<(*DIMivert);j++)
> > {
> > image[i][j] = (struct macro *)calloc((*DIMjhori-1),sizeof(struct macro));
> > if(!image[i][j])
> > {
> > puts("\nError making DIMjhori image\n");exit(1);
> > }
> > }
> > }
> >
> > free(DIMivert);free(DIMjhori);
> > }
> >
> > ///////////////////////////////////////
>


Cette discussion est classée dans : int, image, unsigned, struct, dimivert


Répondre à ce message

Sujets en rapport avec ce message

pb de progr [ par airwann ] bonjour,j ai un pb ds mon code (je ne suis pas un expert) mais là je ne vois pas ou ça plante ..////////////////////////////////////////////////////// transformer un tableau 2d en image bitmap [ par gyzmo1 ] Bonjour a tous, voilà mon problème, je suis en train de mettre en place une méthode de comparaison de signature manuscrites. Cette méthode s applique Problème pour compiler du c [ par flox39 ] Salut à tous Je suis en galère avec du code qu'on m'a passé je n'arrive pas a le compilerl'erreur c error C2447: missing function header (old-style fo Déplacer une image avec la souris [ par ingelishome ] Bonjour,Je suis en train de faire une petite appli sous Borland C++ Builder dans lequel j'ai besoin de déplacer une image. Pour ce faire j'ai eu au dé unsigned long int [ par W@$h! ] saluje pense que tout le monde sait faire ça : int valeur = 4;printf("%i", valeur);mais quelqu'un peut'il me dire comment faire pour afficher un unsig Pb d'allocation avec New [ par iunknow ] Salut,J'ai un petit pb d'allocation avec le new à partir d'une certaines taille que ne me parrait pas énorme.retMetaData->ptViews = new CmcMetaViewStr Marche pas : Changer la résolution de l'écran [ par yserver ] Bojours.La réponse sera a prioris toute bête. Je pose qd même mon code qui à passer pour un idiot, mais faut bien avancer.Donc le pb c'est cette fonct PB compilation de socket [ par dhylde ] Bonjour a tous, j'ai un petit souci de compilation (j'ai du manqué l'inclusion d'une Librairy). Bref je me prend la tete depuis ce matin. Je suis sous Passer une struct dans une shared memory POSIX [ par cobbleguard ] Salut,J'ai 3 processus indépendants qui communiquent.PS1 reçoit des valeurs saisies au clavier, les met dans une structure et les envoie au PS2 via un Raw socket TCP/IP sous Windwos XP [ par MaximeH ] Bonjour à tous, J'aimerais savoir pourquoi ce code ne marche pas (il n'es pas de moi, c'est sensé être un exemple ...) : ###code // SheepTCP->SYN Ha


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

Photothèque

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,874 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales