09-18-2011
Quote:
Originally Posted by
agama
An enum is interpreted by the compiler and not the preprocessor.
That explains it.
Okay, redone with #define's and it works. Ordinarily I'd avoid preprocessor tricks, except PIN_A defines a value that's used in both preprocessor and expression contexts -- it can be used as an integer like (1<<PIN_A), to define an 8-bit number to be fed into PORTA, or as part of a variable name RA[0-9] to define a member of a bitfield...
8 More Discussions You Might Find Interesting
1. Programming
helo i have asked in exam what that what is the base type of
enum
options are given bewlo
(1) long int
(2) short int
(3) signed int
(4) unsigned int
can u tell me what is the exact answer from the above option
Regards,
Amit (1 Reply)
Discussion started by: amitpansuria
1 Replies
2. IP Networking
Hi Guys,
This is really really urgent. Am looking out for some quick answers.
I'm developing a DNS Resolver client that interprets DNS Query repsonses & pass on the needful to DNS applications.
When an ENUM query(modified to an nslookup naptr query) is issued & an NAPTR RR(Resource Record)... (1 Reply)
Discussion started by: smanu
1 Replies
3. Programming
Hi,
Anyone please explain the functionality of ## in c.
I didn't get the following preprocessor directives,
# define LL(x) x ## LL
# define LL(x) x ## i64
Thanks,
Naga:cool: (1 Reply)
Discussion started by: Nagapandi
1 Replies
4. Programming
#include <iostream>
#include <stdio.h>
using namespace std;
typedef struct A
{
enum a{ red,blue,green}a;
}obj11;
obj11 obj1;
int main()
{
//obj1.a=red; // how to set variable ?
cout<<"sizeof struct is n"<<sizeof(obj1);
cout<<"obj1.a is"<<obj1.a;
if... (1 Reply)
Discussion started by: crackthehit007
1 Replies
5. Programming
Hi,
Just wondering if it is possible to trim the file path output by __FILE__ preprocessor in my debugging line.
Let's say my main.cpp file is found in C:\User\MyName\SystemA\Mod1\SubMod2\Test\main.cpp
for __FILE__, I just want the filename - main.cpp to be printed, instead of the entire... (2 Replies)
Discussion started by: tanlccc
2 Replies
6. Programming
I am trying to implement a spare array in C that would be referenced by regular integers.
Right away: define array for maximum possible index elements completely is not what I trying to get!!!
It should be a construction that would have just 2 elements if I need to have just two indexes, like... (8 Replies)
Discussion started by: alex_5161
8 Replies
7. Programming
Hi All,
I came across this error "MIXING ENUM TYPES" when I run my C program against the Coverity Tool. I've made many search relating to the error, but I didnt find the exact solution. Can anyone help me to overcome this.?
Thanks in Advance.!! (3 Replies)
Discussion started by: Parameswaran
3 Replies
8. Programming
I am currently using Linux CentOS and programming in FORTRAN 90 using Portland 7.1 compiler.
I am able to set in the preprocessor directives a flag called TEST. when I go to use logic in my code i can write
#ifdef TEST
execute something
#endif
Furthermore, if I want to negate the... (2 Replies)
Discussion started by: prodigious8
2 Replies
LEARN ABOUT SUSE
gtk2::pagesetup
Gtk2::PageSetup(3) User Contributed Perl Documentation Gtk2::PageSetup(3)
NAME
Gtk2::PageSetup
HIERARCHY
Glib::Object
+----Gtk2::PageSetup
METHODS
pagesetup = Gtk2::PageSetup->new
pagesetup = Gtk2::PageSetup->new_from_file ($file_name)
o $file_name (localized file name)
May croak with a Glib::Error in $@ on failure.
Since: gtk+ 2.12
pagesetup = Gtk2::PageSetup->new_from_key_file ($key_file, $group_name)
o $key_file (Glib::KeyFile)
o $group_name (string or undef)
May croak with a Glib::Error in $@ on failure.
Since: gtk+ 2.12
double = $setup->get_bottom_margin ($unit)
o $unit (Gtk2::Unit)
$setup->set_bottom_margin ($margin, $unit)
o $margin (double)
o $unit (Gtk2::Unit)
double = $setup->get_left_margin ($unit)
o $unit (Gtk2::Unit)
$setup->set_left_margin ($margin, $unit)
o $margin (double)
o $unit (Gtk2::Unit)
$setup->load_file ($file_name)
o $file_name (string)
May croak with a Glib::Error in $@ on failure.
Since: gtk+ 2.14
$setup->load_key_file ($key_file, $group_name)
o $key_file (Glib::KeyFile)
o $group_name (string or undef)
May croak with a Glib::Error in $@ on failure.
Since: gtk+ 2.14
pageorientation = $setup->get_orientation
$setup->set_orientation ($orientation)
o $orientation (Gtk2::PageOrientation)
double = $setup->get_page_height ($unit)
o $unit (Gtk2::Unit)
double = $setup->get_page_width ($unit)
o $unit (Gtk2::Unit)
double = $setup->get_paper_height ($unit)
o $unit (Gtk2::Unit)
$setup->set_paper_size_and_default_margins ($size)
o $size (Gtk2::PaperSize)
papersize = $setup->get_paper_size
$setup->set_paper_size ($size)
o $size (Gtk2::PaperSize)
double = $setup->get_paper_width ($unit)
o $unit (Gtk2::Unit)
double = $setup->get_right_margin ($unit)
o $unit (Gtk2::Unit)
$setup->set_right_margin ($margin, $unit)
o $margin (double)
o $unit (Gtk2::Unit)
$setup->to_file ($file_name)
o $file_name (localized file name)
May croak with a Glib::Error in $@ on failure.
Since: gtk+ 2.12
$setup->to_key_file ($key_file, $group_name)
o $key_file (Glib::KeyFile)
o $group_name (string or undef)
Since: gtk+ 2.12
double = $setup->get_top_margin ($unit)
o $unit (Gtk2::Unit)
$setup->set_top_margin ($margin, $unit)
o $margin (double)
o $unit (Gtk2::Unit)
ENUMS AND FLAGS
enum Gtk2::PageOrientation
o 'portrait' / 'GTK_PAGE_ORIENTATION_PORTRAIT'
o 'landscape' / 'GTK_PAGE_ORIENTATION_LANDSCAPE'
o 'reverse-portrait' / 'GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT'
o 'reverse-landscape' / 'GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE'
enum Gtk2::Unit
o 'pixel' / 'GTK_UNIT_PIXEL'
o 'points' / 'GTK_UNIT_POINTS'
o 'inch' / 'GTK_UNIT_INCH'
o 'mm' / 'GTK_UNIT_MM'
SEE ALSO
Gtk2, Glib::Object
COPYRIGHT
Copyright (C) 2003-2008 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
perl v5.12.1 2010-07-05 Gtk2::PageSetup(3)