C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 02-22-2009, 03:49 PM   #1
Registered User
 
Join Date: Feb 2009
Posts: 3
array of structures as an argument

Hi,
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();
	}
can anyone tell me what do I do wrong? I just want it to be the way that if the element that emits the signal has a value stored in its poziceee and it equals 7 then to execute the quit function...
koszta is offline   Reply With Quote
Old 02-22-2009, 03:58 PM   #2
and the Hat of Guessing
 
tabstop's Avatar
 
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   Reply With Quote
Old 03-21-2009, 03:59 PM   #3
Registered User
 
Join Date: Mar 2009
Posts: 1
can u teach me c++
locke is offline   Reply With Quote
Reply

Tags
array, callback

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 05:49 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22