39 Discussion / Question Topics
Remove Filter
|
|
|
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 … |
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
<?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 } ?> |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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. … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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' … |
|
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???? |
|
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" … |
|
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 … |
|
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... … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
hello I have done this program that prompts the user to input the length of the sides of a triangle and outputs the shape of the triangle. Using an enumeration type, triangleType, that has the values scalene, isosceles, equilateral, and notTriangle. so the problem i ma having with the program … |
The End.