|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 783
|
[C] Funzione, header e struttura.
Salve a tutti, mentre cercavo di alleggerire il mio sorgente dove c'è il main ho avuto alcuni problemi. Volevo togliere alcune funzioni presenti nel file e crearne un altro per migliorare la leggibilità.
Cerco di spiegare meglio il problema riportando la struttura del mio programma: Codice:
#define <> .... struct mydata { double **bla0; double **bla1; }; void funzione(void *data) { struct mydata *dptr; dptr=(struct mydata *)data; operazioni varie con dptr->bla0[i][j] } int main() { .... funzione() .. } header Codice:
void funzione(void *data); tagliato e incollato la funzione che prima era nel sorgente del main. A questo punto quando compilo mi dice Codice:
error C2037: left of 'bla1' specifies undefined struct/union 'mydata' Grazie a tutti.
__________________
"May the wind always be at your back and the sun upon your face. And may the wings of destiny carry you aloft to dance with the stars...." Ultima modifica di salvodel : 09-07-2008 alle 17:16. |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 783
|
Per il momento ho risolto inserendo la definizione della struttura anche nel sorgente dove c'è la funzione
![]() ![]()
__________________
"May the wind always be at your back and the sun upon your face. And may the wings of destiny carry you aloft to dance with the stars...." |
![]() |
![]() |
![]() |
#3 |
Senior Member
Iscritto dal: Mar 2005
Città: Morimondo city
Messaggi: 5491
|
fai un file.h con le tue struct e poi lo includi dove serve,no?
__________________
Khelidan |
![]() |
![]() |
![]() |
#4 | |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 783
|
Quote:
![]()
__________________
"May the wind always be at your back and the sun upon your face. And may the wings of destiny carry you aloft to dance with the stars...." |
|
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 09:38.