473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Global array.

Bear with me, it's been a decade or so since I programmed a
computer.

I have an array of structures w/ function pointers I need to make
globally accessible. How do I do that?

I used to do this all the time, but I've forgotten so much. :)

Jul 9 '07 #1
3 1474
On Jul 8, 7:17 pm, rsprawls <rspra...@gmail.comwrote:
Bear with me, it's been a decade or so since I programmed a
computer.

I have an array of structures w/ function pointers I need to make
globally accessible. How do I do that?

I used to do this all the time, but I've forgotten so much. :)
I wasn't complete. I know how to make it global within the source file
it's declared and defined. I need to make it accessible outside of
that.

Jul 9 '07 #2
rsprawls <rs******@gmail.comwrites:
On Jul 8, 7:17 pm, rsprawls <rspra...@gmail.comwrote:
>Bear with me, it's been a decade or so since I programmed a
computer.

I have an array of structures w/ function pointers I need to make
globally accessible. How do I do that?

I used to do this all the time, but I've forgotten so much. :)

I wasn't complete. I know how to make it global within the source file
it's declared and defined. I need to make it accessible outside of
that.
declare it outside of any functions and reference it using
"extern". Of course some bright spark will try and tell you that there
are no such things are "global variables" in C - but that's nitpicking
to say the least.

http://www.physics.uq.edu.au/people/...hys/node7.html

Best of luck getting used to C again!
Jul 9 '07 #3
On Jul 8, 8:19 pm, rsprawls <rspra...@gmail.comwrote:
On Jul 8, 7:17 pm, rsprawls <rspra...@gmail.comwrote:
Bear with me, it's been a decade or so since I programmed a
computer.
I have an array of structures w/ function pointers I need to make
globally accessible. How do I do that?
I used to do this all the time, but I've forgotten so much. :)

I wasn't complete. I know how to make it global within the source file
it's declared and defined. I need to make it accessible outside of
that.
See FAQ <http://c-faq.com/question 1.7 <http://c-faq.com/decl/
decldef.html>.

Robert Gamble

Jul 9 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: miguel | last post by:
I have a number of global variables declared, like so: /** * @global string $GLOBALS * @name $foo */ $GLOBALS = 'something'; /** * @global string $GLOBALS
3
by: K B | last post by:
I have an application that loads an array in the global ASA file. Sometimes that array gets lost for no real reason, resulting in a ubound error. MS has a solution which involves removing...
1
by: Nimmi Srivastav | last post by:
There's a rather nondescript book called "Using Borland C++" by Lee and Mark Atkinson (Que Corporation) which presents an excellent discussion of overloaded new and delete operators. In fact there...
7
by: Ekim | last post by:
hello, I'm using MANAGED C++ and need one of the following two questions answered: 1.) How can one make a global managed array? I'm thinking on something like defining static System::Byte...
8
by: john townsley | last post by:
whats the best way to declare Global objects (holding say 10 member variables and functions) of an unknown size in c++, memory efficient as possible thanks
35
by: whisper | last post by:
My question is whether it is better to use a global variable to hold a dynamically malloced multidim array or pass around pointers to it. The details are below (forgive the long winded explanation)...
4
by: Bilgehan.Balban | last post by:
Hi, The following code: #include <stdio.h> // const int const_asize = 10; #define define_asize = 10; int array = {1,2,3,4,5,6,7,8,9,0};
12
by: a | last post by:
def fn(): for i in range(l) global count count= .... how do i declare count to be global if it is an array subsequently i should access or define count as an array error:
3
by: Jeff | last post by:
Quick questions I can't find answers to: Is there a shortcut to do this: if(! $some_var){$some_var = 'some_other_value'} I'm used to this: $some_var ||= 'some_other_var'; PHP manual doesn't...
112
by: istillshine | last post by:
When I control if I print messages, I usually use a global variable "int silent". When I set "-silent" flag in my command line parameters, I set silent = 1 in my main.c. I have many functions...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.