473,326 Members | 2,134 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,326 software developers and data experts.

structure variables are static

Are structure variables are static in C
Aug 1 '08 #1
4 1560
JosAH
11,448 Expert 8TB
Are structure variables are static in C
Who told you that? A structure variable can be (static) local or global, its address
or its value(s) can be passed to functions and it can be dynamically allocated;
just like any other variable.

kind regards,

Jos
Aug 1 '08 #2
Hi jos,
if i declear a strucutre as global, will all the variable in that structure are static?
Aug 1 '08 #3
JosAH
11,448 Expert 8TB
Hi jos,
if i declear a strucutre as global, will all the variable in that structure are static?
What do you mean by 'static'? C has a very strict definition of the word 'static'
and I suspect you're trying to use it in another meaning.

kind regards,

Jos
Aug 1 '08 #4
Banfa
9,065 Expert Mod 8TB
Hi jos,
if i declear a strucutre as global, will all the variable in that structure are static?
There are no variables in a structure. There are members in a structre and you can declare a variable of the type of that structure.
Aug 1 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: Thomas Matthews | last post by:
Hi, Given a structure of pointers: struct Example_Struct { unsigned char * ptr_buffer; unsigned int * ptr_numbers; }; And a function that will accept the structure:
10
by: gmtonyhoyt | last post by:
It's been mentioned to me that, in standard c, that you can have structures behave very much like classes in relation to something to do with function calls within a structure. Now, I didn't get...
2
by: Cybertof | last post by:
Hello, I would like to understand the difference between declaring a structure/variable in a class body, and doing the same thing in a procedure body. Example : In the following code, what...
4
by: sandeep | last post by:
Hi why we cannot have static as a structure member? & also is there any way to achive data hiding in C at this level( i.e. access only selected structure member ) following code gives syntax...
2
by: Pedro Pinto | last post by:
Hi there! I'm presented with the following situation: I'm writing a server program that receives information and saves it to a structure i've created that goes by the name of tabela. The...
5
by: kselvaakumar | last post by:
I have declared a global structure like this: struct { float a; float b; }static one; This is in a separate header file file1.h; Now how can i initialise those variables one.a and one.b in...
55
by: Zytan | last post by:
I see that static is more restricted in C# than in C++. It appears usable only on classes and methods, and data members, but cannot be created within a method itself. Surely this is possible in...
5
by: Bob Altman | last post by:
Hi all, I have a private static structure in a C++ class (it's a CRITICAL_SECTION structure) that needs to be initialized by passing its address to a routine (InitializeCriticalSection). Since...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.