LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-05-2004, 03:05 PM   #1
woodywellhung
Member
 
Registered: Feb 2004
Location: Lincoln, UK
Distribution: red hat 9
Posts: 67

Rep: Reputation: 15
Creating array of GTKWidgets - is this possible?


Can anyone tell me if it is possible to create an array of GTKWidgets and if so how?. Ive tried this sort of declaration:-

GTKWidget *myButtons[10];

but the compiler wont have it.
 
Old 05-05-2004, 03:44 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
GTKWidget myButtons[10]; will give you a static array of 10 GTKWidget's.

GTKWidget *myButtons; will give you a dynamic array which you will then have to allocate memory for using malloc and realloc.

GTKWidget *myButtons[10]; would give you a pointer to an array of 10 GTKWidget's. Which is probably not what you want unless you want to be able to dynamic allocate arrays of 10 buttons.

Last edited by jtshaw; 05-05-2004 at 03:46 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
array c++ harrylee2003 Programming 3 10-14-2005 05:04 PM
Array help DropHit Linux - Software 0 06-30-2005 09:31 PM
PERL: Size of an array of an Array inspleak Programming 2 03-10-2004 02:24 PM
Array Question? Gerardoj Programming 4 10-02-2003 12:21 AM
2-D Array clowns119 Programming 10 09-24-2003 10:15 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration