LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-26-2008, 12:36 AM   #1
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Rep: Reputation: 30
a few questions about C++ source code


Hello,

I have certain source code before my eyes, but I Can't understand certain parts of it:

1. #pragma - what does it mean, is it some directive for precompilator?.
for example: what does it mean - #pragma resource "*.dfm;" or
or #pragma package (smart_init);?.
2. what does word __fastcall mean in expression
int __fastcall ABC:SetABC() {};
3. what does expression: k = 1 << i; mean?.
4. what is the effect of running following line of text:
SignalForm->CheckBox20->Enabled = (maskIO & 0x08) ? true :
false;
I particularly mean expression in parenthesis: (maskIO & 0x08) what
does it mean?.
Shouldn't there be applied bit conjunction operator?.

Thank You for answer.
 
Old 09-26-2008, 02:24 AM   #2
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
1°) #pragma are preprocessor directives, like everything beginning with a #
2°) __fastcall is a function calling convention
3°) "<<" is the bit shift operator
4°) (TEST) ? (WHEN_TRUE) : (WHEN_FALSE) is evaluated to "WHEN_TRUE" when TEST is true, WHEN_FALSE otherwise, & is the bitwise and operator

Try google for something like #pragma or __fastcall doesn't take more time than posting... And a C++ tutorial could be intersting too
 
Old 09-26-2008, 02:31 AM   #3
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
#pragma directives are non-portable compiler directives; you need to look at the documentation for the compiler which is intended to build that software to find out what a particular #pragma does.

The '&' is the bitwise AND operator (see any book on the C compiler).
So (maskIO & 0x08) results in '0x80' (128 in unsigned decimal) if bit 3 of the maskIO variable is set and '0' otherwise.
 
  


Reply



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
LXer: Voip Encryption, source code open source LXer Syndicated Linux News 0 07-09-2006 03:21 PM
start to read the source code and have questions pipehappy Linux - Newbie 1 01-05-2005 02:19 AM
some questions encounted during reading the source code qqrilxk Linux - Security 1 12-08-2004 09:23 PM
Questions about how to read OS source code hegel Programming 1 10-28-2003 12:18 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:33 AM.

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