Some questions about Gtk::TreeRow.



1. Is it possible/advisable to do something like this?

prototype function: foo(int *number);


struct bar
{
   int a;
   int b;
};

foo(&bar(row[columns.bar_struct]).a);

This compiles, but when I LATER check "bar(row[columns.bar_struct]).a" it hasn't changed. Is it possible to pass it by reference?


2. How about something like this:

struct bar
{
   int *a;
   int *b;
};

bar(row[columns.bar_struct]).a = new int;
*bar(row[columns.bar_struct]).a = 0;

This compiles but segfaults on *bar(row[columns.bar_struct]).a = 0;
Why can't I assign a value to data pointed by the pointer? Am I missing something on the dereferencing?


Hotmail: Δωρεάν, αξιόπιστη και αποτελεσματική υπηρεσία email. Αποκτήστε το τώρα.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]