473,505 Members | 13,696 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I declare a static array in a structure

montzter
15 New Member
Hello,

can somebody suggest any alternative of the code below?
I want the values in the array to be flexible as much as I can.
/*************************************************/

typedef struct
{
static char* SomethingToStore[]={
(ByteType*)"sometext here",
(ByteType*)"sometext here",
(ByteType*)"sometext here",
(ByteType*)"sometext here",
(ByteType*)"sometext here"
};

static char* AnotherSomethingToStore[]={
(ByteType*)"sometext here",
(ByteType*)"sometext here",
(ByteType*)"sometext here",
(ByteType*)"sometext here",
(ByteType*)"sometext here"
};

} endOfStruct;
/************************************************/

I can make this work if I will declare this outside a structure or as a global variable.

Thanks for the help.
Aug 30 '06 #1
1 3319
Banfa
9,065 Recognized Expert Moderator Expert
Why would you want to declare a static array in a structure, I can think of no situation where this would be useful.
Aug 30 '06 #2

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

Similar topics

1
2061
by: mosfet | last post by:
Hi, I have some problems to write my class : if I put the structure declaration before my class i have a compiler error since my CHTTPServerCe is not yet known from the compiler but if I put...
2
3473
by: Mackan | last post by:
Hi! I'm trying to declare a structure that will be including pointers to functions. These structures in turn will be pointed to in an array and depending on a index value that specific function...
1
6959
by: Richard A. Lowe | last post by:
I'm successfully using SendInput to emulate mouse events for a legacy app, delcared like so: public extern static int SendInput( int theCount, ref INPUT pInputs, int theSize ); From the...
8
14461
by: John Dann | last post by:
Trying to declare a structure that will contain a couple of fixed-size arrays. I'm trying eg: Structure IndexRecord Dim testarray(16) as Byte etc End Structure But vb.net is refusing to let...
8
10145
by: redefined.horizons | last post by:
I would like to have an array declaration where the size of the array is dependent on a variable. Something like this: /* Store the desired size of the array in a variable named "array_size". */...
3
20815
by: johnmmcparland | last post by:
Hi all, I would like to have a static constant array inside a class definition which would contain the number of days in each month (I am writing a Date class as an exercise). However my...
1
2112
by: peary | last post by:
Hi, everyone, I'm writing a program to discover wireless network using Windows Native Wifi API & VB.net. I have to declare the windows API in my VB.net program. The original windows...
27
5472
by: arkmancn | last post by:
Any comments? thanks. Jim
10
2445
by: Tammy | last post by:
Hello all, I am wondering what is the best way to declare a struct to be used in other c and c++ files. Such as for a C API that will be used by others. 1. Declaring the typedef and the...
0
7213
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
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7366
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...
1
5026
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...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.