40 Topics

Member Avatar for
Member Avatar for ffonz

I managed to get the value of an enum via reflection. I have to use reflection since I have different objects with enums in them. But how do I get the name of the enum? Let's say I have [CODE] enum MyEnum { A, B } [/CODE] I can get …

Member Avatar for Oscar_5
0
8K
Member Avatar for kent.johnstone_1

In the following code I'm trying to make "SRAM", "FRAM", "EEPROM", and "FLASH" constants, MEM_TYPE an 8-bit variable that can be changed by other programs. The pointer should be pointing to MEM_TYPE. I'm getting a error under uint8_t (defined as BYTE elsewhere in an included file), "*", *and enum which …

Member Avatar for Nutster
0
239
Member Avatar for matrixdevuk

I am trying to get the following ENUM to work, but it's not working. Any help is appreciated. class Colour(Enum): WHITE = (255,255,255) BLACK = (0,0,0) RED = (215,45,45) BLUE = (45,87,214) YELLOW = (230,223,48) GREEN = (45,194,64) Using it: `Colour.BLACK` Error: /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 "/Users/blooop/main.py" Traceback (most recent call last): File …

Member Avatar for matrixdevuk
0
344
Member Avatar for ddanbe

Maybe a bit silly question, but in one of my projects I needed an enum and I suddenly wondered what would be the best place for it to write it in a file. Should it be in a .cs file of his own or could I place it in the …

Member Avatar for RichardGalaviz
0
365
Member Avatar for Vikram Sehgal

is there an easier way to write this code?? without using enum, enum MenuState{MenuPlay,MenuHelp,MenuExit}; MenuState ms=MenuPlay; char ch=0;//or anything other than '\r' while (ch!='\r')//IIRC getch returns '\r' when user hits enter { switch (ms) { case MenuPlay: cout<<"--> PLAY\n HELP\n EXIT\n"; break; case MenuHelp: cout<<" PLAY\n--> HELP\n EXIT\n"; break; case …

Member Avatar for L7Sqr
0
262
Member Avatar for jwenting

Similarly, you can add more fields to an enum and simply provide accessor methods to retrieve them. For example you could change it to have an extra field indicating an output directory to write specific types of data to, and a getter method to return that directory.

Member Avatar for jwenting
0
242
Member Avatar for ParPau

Having issues with array. Seems to pull in the enum files (month and average rainfall) and print accordingly. Also seems to read in the updated rainfall per month. However, problem is I can not make updated print with the enum. Also, last line in program has ..."actual[i]". If use a …

Member Avatar for ParPau
0
274
Member Avatar for pwolf

one of my goals for this year is to learn java, and I found an excuse to get started lately. So over hte last couple of hours I have been reading tutorials and the likes, and started following the advice from this post http://www.daniweb.com/software-development/java/threads/99132/starting-java-java-tutorials-resources-faq As such I am up to …

Member Avatar for JamesCherrill
0
341
Member Avatar for rahul_29

<?php mysql_select_db("store"); $t="SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'stoke' AND COLUMN_NAME = 'catogory'"; $q=mysql_query($t); while($r=mysql_fetch_array($q)) { $y=$r['COLUMN_TYPE']; $u=explode("','",substr($y,6,-2)); //print_r($u); ?> <select name="category" > <option value="">Select Category:</option> <?php foreach($u as $option) { print("<option>$option</option> "); } ?> </select> <?php } ?>

0
178
Member Avatar for Labdabeta

I need to know which of these three copies of code is considered best. I also need to which one is more efficient memory wise and which is more efficient time wise. Thanks: enums [CODE]enum MyEnum{EnumTypeOne=1,EnumTypeTwo=2,EnumTypeThree=4,EnumTypeFour=8};[/CODE] macros [CODE]#define EnumTypeOne 1 #define EnumTypeTwo 2 #define EnumTypeThree 4 #define EnumTypeFour 8 typedef …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for prettyknitty

I have been working on this for awhile, but I was hoping to get input from someone with more experience. I have to stick with the structure and enum format for the assignment, but I was wondering if anyone had any opinions on the way the high/low temperature sections should …

Member Avatar for kal_crazy
0
742
Member Avatar for amvx86

Hello all, I am trying to get a bunch of sub-keys and values from the registry in vb 2010 and i remember in vb6 this was quite easy. Can anyone share code to help? Or a link where I can go? I've been searching for nearly 8 hours on line …

Member Avatar for amvx86
0
2K
Member Avatar for xHellghostx

Hello guys, so I am facing a problem to understand the following.. Creating a GUI based program that has a user control box that contains a list of images of a 52 cards deck, the cards are based on an enum actually 2 enums one for the rank and one …

Member Avatar for Ketsuekiame
0
255
Member Avatar for UKnod

I have a warning that I can;t get rid of: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. I am pretty sure it is becasue I have not dimentioned the variable but how do you dimention an IO.memorystream. …

Member Avatar for UKnod
0
275
Member Avatar for tingwong

Hello all. For my project I have to create a snack machine with mints and cookies. So far I have gotten an array of cookies with the code below. However an interesting problem I'm having is my output: OATMEAL cookie LEMON cookie null CHOCOLATE_CHIP cookie OATMEAL cookie LEMON cookie null …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Yoink

Hi, I have to write a program that plays out a whole game of the card game WAR. I have to create a bunch of classes that go along with some pre written classes so right now im trying to start out small and work my way up. We are …

Member Avatar for Yoink
0
683
Member Avatar for dinhunzvi

i have a problem. i have a table that has one column that should accept one of a set of defined values. i know in MySQL i use the following command to create the table: CREATE TABLE tblstudents ( studentID int( 8 ) UNSIGNED NOT NULL AUTO_INCREMENT, lastName VARCHAR( 20 …

Member Avatar for BitBlt
0
205
Member Avatar for poloblue

Good Afternoon, I'm having trouble with loops that deal with enumeration. So far I have this code #include <iostream> #include <fstream> #include <string> #include <cstring> #include <cmath> #include <cstdlib> #include <iomanip> using namespace std; int main( ) { //enumerate type definition enum weekDays {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday,Sunday}; //variable …

Member Avatar for Lucaci Andrew
0
291
Member Avatar for hous3aholik

Im trying to create a deck of cards using enums. I already have my enum declared, but I'm stuck in how exactly to create the deck of cards using a boolean array. So far i tried to initialize my constructor, but I don't know what direction to take now. Any …

Member Avatar for JamesCherrill
0
707
Member Avatar for phummon

Hola code gurus, I’m wondering if there’s a way to use a string to access a specific item in a matrix of int[X]. I have a program which uses enums as iterators to reference a large amount of data. To select an item in the matrix, the user will enter …

Member Avatar for phummon
0
317
Member Avatar for cheiL

I'm working on a *soap message *to send to a client system. I must use the client's predefined data types specified on their soap to send my message. Theres alot of arrays and enumerators used and my code gives the following error: > Error 1 Cannot implicitly convert type 'UpdateRatePs._Default.Rate.AvailAppType' …

Member Avatar for cheiL
0
258
Member Avatar for sridhar.selva

hi can u ppl help me on this. can i use multiple enums in a single c program, if so is there any constrain on it? [CODE]enum pattern1 {red, green, yellow} pt1; enum pattern2 {orange, blue, black} p2; enum pattern3 {white, grey, violet} p3;[/CODE] is this possible????

Member Avatar for sridhar.selva
0
162
Member Avatar for radiat

I'm studying enumeration at the minute and i've a quick question. In the following code using enum, are you limited to ouputting the sequence number of the possible values, or can you use the enum operator to output the text "green"? [CODE] #include <iostream> #include <sstream> #include <fstream> #include "conio.h" …

Member Avatar for Ab000dy_85
0
179
Member Avatar for Twistar

I am making a simple blackjack game. I have now made the deck which i can draw cards from. But I don't know how to get the values from each card so that i can add them together. I have a card class named Kort with the enum: [CODE]public enum …

Member Avatar for Twistar
0
262
Member Avatar for schoolboy2010

Holler fellow programmers I have an error that's been bugging me for almost a day now: I keep getting 14 of this error: class, interface, or enum expected Yes, 14 different exact same error message basically for every line of code in the inputGetter method below. Can someone please help... …

Member Avatar for JeffGrigg
0
4K
Member Avatar for kira_

Good day y'all.. I was never introduced properly to PHP so I come here a lot to seek for help. xd anyways, I have a problem at the moment.. I can't set my enum values properly.. This is how it was added to a table named "joke": [CODE]ALTER TABLE joke …

Member Avatar for kira_
0
1K
Member Avatar for tdba.316

After a few months of learning and practicing C++ with the book C++ Primer Plus through Chapter 7, I decided to do myself a little simple program. I started with the decision to try splitting my program into multiple files, and I decided to collect all shared declarations/definitions (*) into …

Member Avatar for tdba.316
0
2K
Member Avatar for gavriela

Hello, I'm a student working on my first hands-on assignment. One of the questions is this: Q4: Write a program that converts a user input temperature from degree Celsius to Fahrenheit or Fahrenheit to Celsius using: C = 5 (F -32)/9 or F = 9C/5 + 32 The user must …

Member Avatar for ~s.o.s~
0
406
Member Avatar for lanzslumber

Hello, I'm a beginner in these to programming language. Here I want to know how to display the actual value of variable of enum holds. Like this in C++: [code] #include <iostream> #include <conio.h> using namespace std; int main(void) { enum Difficulty { Low = 1, Medium, High }; Difficulty …

Member Avatar for ddanbe
0
242
Member Avatar for roemhildtg

Hello all, I am enrolled in an intro to C++ class, and I need some help on our final program. Any suggestions are greatly appreciated, as I am quite new to this please don't criticize. Our program requirements require us to receive a command (I.E. delete) input as an array …

Member Avatar for daviddoria
0
206

The End.