Sponsored Content
Full Discussion: enum and C preprocessor
Top Forums Programming enum and C preprocessor Post 302556464 by Corona688 on Sunday 18th of September 2011 03:58:14 PM
Old 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

what is the base type of enum

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

DNS ENUM RR interpretation

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

Preprocessor

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

enum in c++

#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

Preprocessor __FILE__ for Debugging

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

C- trying to code a 'spare array'; 'enum' fauled.

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

Mixed enum types - coverity defect

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

Use #if not defined with OR boolean logic in preprocessor directives

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
Gnome2::Canvas::RichText(3pm)				User Contributed Perl Documentation			     Gnome2::Canvas::RichText(3pm)

NAME
Gnome2::Canvas::RichText - Rich text canvas item HIERARCHY
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gnome2::Canvas::Item +----Gnome2::Canvas::RichText METHODS
textbuffer = $text->get_buffer $text->set_buffer ($buffer) o $buffer (Gtk2::TextBuffer) $text->copy_clipboard $text->cut_clipboard textiter = $text->get_iter_at_location ($x, $y) o $x (integer) o $y (integer) rectangle = $text->get_iter_location ($iter) o $iter (Gtk2::TextIter) $text->paste_clipboard PROPERTIES
'anchor' (Gtk2::AnchorType : default "north-west" : readable / writable) Anchor point for text 'cursor-blink' (boolean : default true : readable / writable) Does the cursor blink in this rich text item? 'cursor-visible' (boolean : default true : readable / writable) Is the cursor visible in this rich text item? 'direction' (Gtk2::DirectionType : default "tab-backward" : readable / writable) Text direction 'editable' (boolean : default true : readable / writable) Is this rich text item editable? 'grow-height' (boolean : default false : readable / writable) Should the text box height grow if the text does not fit? 'height' (double : default 0 : readable / writable) Height for text box 'indent' (integer : default 0 : readable / writable) Number of pixels for indentation 'justification' (Gtk2::Justification : default "left" : readable / writable) Justification mode 'left-margin' (integer : default 0 : readable / writable) Number of pixels in the left margin 'pixels-above-lines' (integer : default 0 : readable / writable) Number of pixels to put above lines 'pixels-below-lines' (integer : default 0 : readable / writable) Number of pixels to put below lines 'pixels-inside-wrap' (integer : default 0 : readable / writable) Number of pixels to put inside the wrap 'right-margin' (integer : default 0 : readable / writable) Number of pixels in the right margin 'text' (string : default undef : readable / writable) Text to display 'visible' (boolean : default true : readable / writable) Is this rich text item visible? 'width' (double : default 0 : readable / writable) Width for text box 'wrap-mode' (Gtk2::WrapMode : default "word" : readable / writable) Wrap mode for multiline text 'x' (double : default 0 : readable / writable) X position 'y' (double : default 0 : readable / writable) Y position SIGNALS
tag-changed (Gnome2::Canvas::RichText, Glib::Object) ENUMS AND FLAGS
enum Gtk2::AnchorType o 'center' / 'GTK_ANCHOR_CENTER' o 'north' / 'GTK_ANCHOR_NORTH' o 'north-west' / 'GTK_ANCHOR_NORTH_WEST' o 'north-east' / 'GTK_ANCHOR_NORTH_EAST' o 'south' / 'GTK_ANCHOR_SOUTH' o 'south-west' / 'GTK_ANCHOR_SOUTH_WEST' o 'south-east' / 'GTK_ANCHOR_SOUTH_EAST' o 'west' / 'GTK_ANCHOR_WEST' o 'east' / 'GTK_ANCHOR_EAST' o 'n' / 'GTK_ANCHOR_N' o 'nw' / 'GTK_ANCHOR_NW' o 'ne' / 'GTK_ANCHOR_NE' o 's' / 'GTK_ANCHOR_S' o 'sw' / 'GTK_ANCHOR_SW' o 'se' / 'GTK_ANCHOR_SE' o 'w' / 'GTK_ANCHOR_W' o 'e' / 'GTK_ANCHOR_E' enum Gtk2::DirectionType o 'tab-forward' / 'GTK_DIR_TAB_FORWARD' o 'tab-backward' / 'GTK_DIR_TAB_BACKWARD' o 'up' / 'GTK_DIR_UP' o 'down' / 'GTK_DIR_DOWN' o 'left' / 'GTK_DIR_LEFT' o 'right' / 'GTK_DIR_RIGHT' enum Gtk2::Justification o 'left' / 'GTK_JUSTIFY_LEFT' o 'right' / 'GTK_JUSTIFY_RIGHT' o 'center' / 'GTK_JUSTIFY_CENTER' o 'fill' / 'GTK_JUSTIFY_FILL' enum Gtk2::WrapMode o 'none' / 'GTK_WRAP_NONE' o 'char' / 'GTK_WRAP_CHAR' o 'word' / 'GTK_WRAP_WORD' o 'word-char' / 'GTK_WRAP_WORD_CHAR' SEE ALSO
Gnome2::Canvas, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gnome2::Canvas::Item COPYRIGHT
Copyright (C) 2003-2004 by the Gtk2-Perl Team. This software is licensed under the LGPL; see Gnome2::Canvas for a full notice. perl v5.14.2 2011-11-16 Gnome2::Canvas::RichText(3pm)
All times are GMT -4. The time now is 04:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy