473,382 Members | 1,407 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,382 software developers and data experts.

When I declare the following structure in my code

62
Hi all

When I declare the following structure in my code
static struct rwtable{ /* reserved word table */
char *rw_name; /* representation */
int rw_yylex; /* yylex() value */
}rwtable[] = {" ",0};

I am getting the warning that aggregate has a partly braketted initialiser
help me to resolve this warning.

regards

srikar
Oct 31 '06 #1
2 1362
Banfa
9,065 Expert Mod 8TB
It is an array of structures, you need braces for the array and braces for each structure so correctly it is

Expand|Select|Wrap|Line Numbers
  1. static struct rwtable{         /* reserved word table */
  2.         char *rw_name;         /* representation */
  3.         int rw_yylex;           /* yylex() value */
  4.         }rwtable[] = {{" ",0}};
  5.  
If you have more than 1 structure in the array then it becomes

Expand|Select|Wrap|Line Numbers
  1. static struct rwtable{         /* reserved word table */
  2.         char *rw_name;         /* representation */
  3.         int rw_yylex;           /* yylex() value */
  4.         }rwtable[] = {
  5.                 {" ",0},
  6.                 {"A",1}
  7.         };
  8.  
Oct 31 '06 #2
srikar
62
Hai Banfa Thank you very much, I am getting no warnings
after I make the change.
I spent lot of time on it.
thank u very much
regards
srikar


It is an array of structures, you need braces for the array and braces for each structure so correctly it is

Expand|Select|Wrap|Line Numbers
  1. static struct rwtable{         /* reserved word table */
  2.         char *rw_name;         /* representation */
  3.         int rw_yylex;           /* yylex() value */
  4.         }rwtable[] = {{" ",0}};
  5.  
If you have more than 1 structure in the array then it becomes

Expand|Select|Wrap|Line Numbers
  1. static struct rwtable{         /* reserved word table */
  2.         char *rw_name;         /* representation */
  3.         int rw_yylex;           /* yylex() value */
  4.         }rwtable[] = {
  5.                 {" ",0},
  6.                 {"A",1}
  7.         };
  8.  
Oct 31 '06 #3

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

Similar topics

4
by: QQ | last post by:
Hello I am a newbie on network programming. I am trying to receive a packet if((numbytes = recvfrom(udp_fd1, buf, MAXLEN-1, 0,(struct sockaddr*)&register_addr, &addr_len))==-1){ fprintf(stderr,...
2
by: david | last post by:
Well, as a matter of fact I_HAD_MISSED a basic thing or two, anyway, although Ollie's answer makes perfectly sense when dealing with classes, it doesn't seem to me to apply as well if you have to...
5
by: Sakharam Phapale | last post by:
Hi All, How to declare the following statement in following structure. szPname As String * MAXPNAMELEN Public Structure MIXERCAPS public wMid As Integer public ...
4
by: Thomas | last post by:
I tried the following: Public Class ClassA Public Class ClassB Private myName As String Private myBirthday As Date Public Property Birthday() As Date Get Return myBirthday
13
by: Kantha | last post by:
Hi all, I have declared an Union as follows typedef union { struct interrupt_bits { unsigned char c_int_hs_fs_status : 1, c_setup_intflag : 1,
8
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". */...
5
by: sharat | last post by:
hi all can any body tell how to declare the structure pointer within a class. i have written the following program but gettin error. #include<iostream> using namespace std;
4
by: =?Utf-8?B?UHVjY2E=?= | last post by:
The function that I'm trying to call through DLLImport has a parameter that has a C code's vector's Itrator to a structure. I Have marshalled the structure in C# but how do I do the C type...
0
by: Joe HM | last post by:
Hello - I have a *.dll that was compiled from Ada. The following declaration and Structure is working ... Declare Sub XXX Lib "X.dll" (ByRef XState As XStructure) ...
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...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.