CFanatic

Go Back   CFanatic > Programming > C Programming

Join CFanatic Forum Now

struct and varialbe topic posted under C Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-02-2010, 08:50 PM
Junior Member
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
zu1u is on a distinguished road
| More
struct and varialbe

Hi,
I'm not very used to the C syntax, so I'm having this probably rather easy to solve problem for someone with experience.
I have a struct that is of the form

Code:
typedef struct MyStruct{
uint32_t myVar:2;
} MyStruct;
As far as I know the :2 means that I have a myVar that has actually a width of two unit32_t. Is that correct?
Question is, how how can I assign values to one of the 2 single instances of uint32_t?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Allocate memory for an array inside a struct MarounMaroun C Programming 0 08-28-2010 03:11 AM
How sort and do a list after giving struct? DOSASIS09 C Programming 0 02-04-2010 04:41 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 02:40 AM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board