LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-09-2005, 04:24 AM   #1
lucs
Member
 
Registered: Feb 2005
Posts: 39

Rep: Reputation: 15
Unhappy u32 a[]={1,2,5};


Hello to everyone,
I'm a new member, and I've a question!
In a source-code I've met a line like u32 a[]={1,2,5};
Does anyone know what is it? Thanks to all! Lucs
 
Old 02-09-2005, 04:50 AM   #2
fax8
Member
 
Registered: Jul 2004
Location: Italy
Distribution: SlackWare 10 - The Best
Posts: 72

Rep: Reputation: 15
u32 a[]={1,2,5};

it creates an array wich data type is "u32" named as "a" wich contains 1 , 2 , 5 .
 
Old 02-09-2005, 05:00 AM   #3
lucs
Member
 
Registered: Feb 2005
Posts: 39

Original Poster
Rep: Reputation: 15
Thumbs up Thank you fax8

Thank you very much! But, sorry, I've another question...Can you explain, please, me what kind of type is "u32"? Is it an integer or a char renamed? Because I've never seen it before in a source code! Thanks! lucs
 
Old 02-09-2005, 05:08 AM   #4
fax8
Member
 
Registered: Jul 2004
Location: Italy
Distribution: SlackWare 10 - The Best
Posts: 72

Rep: Reputation: 15
in the WONDERFUL C programming language
you can redefine a name for a type.

In your file probably you have something like

typedef oldtypename newtypename;

wich rename the old type "oldtypename" into "newtypename" .

This is useful to read better the file or to define new types
(pointers to structures, also knows as records)
 
Old 02-09-2005, 05:23 AM   #5
lucs
Member
 
Registered: Feb 2005
Posts: 39

Original Poster
Rep: Reputation: 15
reply

In my code there isn't a redefinition....my god! "u32" is used like a standard type, but what type?
For example int contain integer, string contain lots of char and u32? I've searched it in tutorials about C++ and C, but I haven't found it, where can I find a rescue?
 
Old 02-09-2005, 05:30 AM   #6
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
what headers is it importing - namely anything from the kernel? ( typedefs like these are used alot through kernel headers)
 
Old 02-09-2005, 05:34 AM   #7
lucs
Member
 
Registered: Feb 2005
Posts: 39

Original Poster
Rep: Reputation: 15
These are headers that are included...

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/timer.h>
#include <linux/spinlock.h>
#include <linux/version.h>
#include <linux/if_ether.h>
#include <linux/tqueue.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/random.h>
 
Old 02-09-2005, 05:40 AM   #8
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
there's where your typedef's are. check them out, you'll see alot of em. also, check out the glib documentation (go to gnome.org->developer->documentation). It uses it's own system where it typedefs normal types like gchar, gint, etc... but it also has things like gint32, which is a 32 bit int on any system. Something worth checking out.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to install u32??? becky_starr Linux - Software 5 01-15-2004 12:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration