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

structure errors - C

Hello - I have a structure which looks good to me:

Expand|Select|Wrap|Line Numbers
  1. typedef struct t_settings
  2. {
  3.   :
  4.   BOOL var1;
  5.  
  6.   Obj1 var2;
  7.   :
  8. } settings;
  9.  
firstly, what is the "t_" before the structure name mean?

also, I get an error saying syntax error before Obj1...and then a warning saying that no semicolon after struct or union. Why?

Thanks!
Sam
Jul 15 '08 #1
3 1326
gpraghuram
1,275 Expert 1GB
BOOL should be typedefed some where...
What is the use of : in the structure.....

Raghu
Jul 15 '08 #2
I put : there just to show that there is code above and after what I typed, but the compiler did not complain about them...please advise. thanks!
Jul 16 '08 #3
Banfa
9,065 Expert Mod 8TB
I see no type definition of Obj1 in the posted code, are you sure you have included the file where it is defined?

The "t_" is nothing special, it is not uncommon to insert "t_" or "tag" before (or after) the structure name when typedefing a structure to differentiate it from the type name. On my current project we use a "s" prescript on the structure name and a "T" prescript on the typedef name.
Jul 16 '08 #4

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

Similar topics

5
by: kazack | last post by:
I am a little confused with code I am looking at. My c++ book does not go into passing a structure to a function so I pulled out a c book which does. and I do not understand the prototype verses...
4
by: Mikkel christensen | last post by:
Hi there I wonder if any of you could point me in a direction where I can find some usefull information about coding standarts. I have some generel experiense in programming but I lack many...
1
by: Chris R. | last post by:
Hi everyone. I am trying to finish my homework, but I seem not to figure out how to fix this structure that seems to make wrong output. What this program should do is use structure to save the...
5
by: Phil Kelly | last post by:
Hi I need to write the contents of a structure to a binary file - there is one string and 2 integers, but I can't seem to figure out how to write the data correctly. If I am simply writing...
5
by: Rich | last post by:
Suppose the following: typedef void (*funcptrs)(void); typedef struct { unsigned int *in; unsigned int *out; unsigned int *overrun; funcptrs myptrs; /* >=1 for ansi */ } yada;
4
by: gordon | last post by:
Hi I am still fairly new to C#.net and I sometimes make basic program design mistakes - particularyly in the context of paying attention to OOP principles. At the moment I am working on an...
6
by: Aston Martin | last post by:
Hi All, ********************** My Situation ********************** I am working on project that involves passing a structure to unmanaged code from .Net world (well using C#). Perhaps an example...
5
by: =?Utf-8?B?QXlrdXQgRXJnaW4=?= | last post by:
Hi Willy, Thank you very much for your work. C++ code doesnot make any serialization. So at runtime C# code gives an serialization error at "msg_file_s sa = (msg_file_s) bf.Deserialize(ms);"...
14
by: Bill Reid | last post by:
OK, let's say that have a function menu structure declaration like this (since I basically do): typedef struct function_item { char *descrip; void(*function)(void); } t_function_item; ...
25
by: jbholman | last post by:
I am pretty new to C and doing my first project in C. I actually read almost the entire FAQ, but can't seem to figure out this problem. I have a structure. I have a list of these structures. ...
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: 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
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
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...

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.