![]() |
| | #1 |
| Registered User Join Date: Feb 2009
Posts: 3
| array of structures as an argument I m having some problems with a callback function. Let me explain it through code... Code: //I have this structure//
typedef struct
{
int cisliceee;
GtkWidget*nalepka;
int poziceee;
}vstup;
//and an array of these structures//
vstup* v[16];
/*and in this callback function I want a pointer to one element of that array, and then work inside of the structure of this particular element*/
void cudl_stisknut(GtkWidget *widget,vstup*v[])
{
if (v[]->poziceee=7){
gtk_main_quit();
}
|
| koszta is offline | |
| | #2 |
| and the Hat of Guessing Join Date: Nov 2007
Posts: 8,845
| 1) vstup* v[16] is not an array of structures. It's an array of pointers that could point to some structures, should you ever create any. 2) Do you want just a pointer to a single vstup object? Then just do that: vstup *v. |
| tabstop is offline | |
| | #3 |
| Registered User Join Date: Mar 2009
Posts: 1
| can u teach me c++ |
| locke is offline | |
![]() |
| Tags |
| array, callback |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reading the file, and filling the array of structures | BlackOps | C Programming | 13 | 07-12-2009 02:03 PM |
| allocation and reallocation of memory dynamically of an integer array | zamir | C++ Programming | 16 | 05-29-2009 07:25 PM |
| accessing an array of structures | creative | C Programming | 4 | 12-27-2007 12:52 PM |
| Array of Structures: Sorting | Drainy | C Programming | 3 | 04-13-2005 09:55 AM |
| trying to initialize an array of structures | dreamgoat | C Programming | 4 | 09-26-2004 05:33 PM |