199,114 Archived Topics
Remove Filter ![]() | |
i have an insert function: [code=c] template <typename T> void insert(T item) { string T_id = typeid(T).name(); int compare; if(T_id == "char *") compare = stricmp(this.item, item); else compare = this.item < item; // ... insert here } [/code] i'm trying to compare numbers,strings,classes but when T is <char*> i … | |
Hi, I am fairly new to C++ but love to learn, so I wanted to create a simple program base on the group-party game mafia A.K.A "werewolf." Just so whoever is not familiar gets the background. I will use just an example of 10 players. In a ten player game, … | |
Hello guys... I wanna write a program that calculates a customer’s bill for the electric company. But there are two types of customers: residential and commercial. There are two rates for calculating an electric bill. Resident rates – Bill processing fee = $12.50 Service fee = $30.50 Alternative energy fee … | |
we are suppose to write a nice display code for natural numbers in Resolve its OSU version of C++, everytime I enter code and compile it though i get this error? heres my code [CODE] concrete_instance class Queue_Of_Naturals: instantiates Queue_Kernel_1a_C <Natural_Put_To_With_Commas_1> {}; concrete_instance class Sequence_Of_Queue_Of_Naturals: instantiates Sequence_Kernel_1a_C <Queue_Of_Naturals> {}; … | |
I have a class with private strings and after I set information I want to the given strings in that class I need to push that data to a vector, which is stored privately in a separate class...I feel as though my code makes logical sense but obviously I am … | |
Hello, I'm new at this forum, let me just point out I'm not a developer, I'm just a designer who has to strugle to do simple things that work, all by myself - and I'm usually successfull... but not this time, I have searched and searched literally for hours, and … | |
I got an error in ths code... cannot implicitly convert type string to string[].... [code] public string[] SelectTable(String pSqlstmt) { string[] sTable; string str; if(pSqlstmt.Contains("from")) { int strlen=pSqlstmt.Length; int strindfrom = pSqlstmt.IndexOf("from"); if (pSqlstmt.Contains("where")) { int strindwhere = pSqlstmt.IndexOf("where"); sTable = pSqlstmt.Substring(strindfrom, strindwhere); } else { sTable = pSqlstmt.Substring(strindfrom, strlen); … | |
[CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct { int code; char name; float amount; int shares; float c_price; }DATA; typedef struct stockList { DATA stock; stockList* link; }STOCK; STOCK* insertStock(STOCK* pList, STOCK* pPre, DATA item); STOCK* buildList(char* fileID); void printList(STOCK* pList); void fprintList(STOCK* pList); bool searchList(STOCK* pList, STOCK** pPre, … | |
Here is my assignment:Choose a product that lends itself to an inventory (for example, products at your workplace, office supplies, music CDs, DVD movies, or software). • Create a product class that holds the item number, the name of the product, the number of units in stock, and the price … | |
Well I'm trying to make a tool for a game for learning purposes and i can't figure it out, I have Checkbox1 and a button The button saves the ini with the checkbox1.CheckState correctly and when i open it the Checkbox1.CheckState is checked so it works, but when i Delete … | |
Is there a way to grab values from a basic stamp with python? I just bought a Accelerometer and want to read the values with python. | |
I tried to change for loop to do while loop so that I no need to control the value of i in the future. But seems my program crashes. [code] #include<stdio.h> #include<stdlib.h> struct stock { char code[10]; char name[10]; float amt; int held; float price; struct stock *next; }; int … | |
Hello everyone I have an issue here that I couldn't find much info about, I saw a lot about it when people where selecting a lot of data but not on an insert. Heres some background. I have an application that adds items from our in house order/inventory manager to … | |
I didn't realy know where to put this post, so please bear with me... I'm starting a new project with two friends of mine using github for code-hosting (and of cause git for version controll). Also I'm using lighthouse for bugtracking. Github has a nice and fully integrated post-receive hook … | |
Hey Guys. I cant actually think of a way to do this. Let me rephrase my question. I essentially want a perl script to run based on something that i am doing in javascript. for example: <javascript> if(x == 1) { then run the perl script. } </javascript> i dont … | |
hello how to open resume in php or javascript or ajax or how to open .doc file in php or how to read .doc file in | |
hi, can anyone help me with my assignment, I'm new in c++ and any help will be much appreciated: "You must design, implement and test a simple board game. The design should follow object oriented principles and use the UML tools that were introduced earlier in the module. The coding … | |
Just when I thought I was comfortable with SQL queries, another one popped up that I can't get around with.... I'm ALMOST there but not quite. Here is the situation... I'm dealing with two tables [B]PoolTeams[/B] and [B]PlayerStats[/B] The PoolTeams table has two columns: [B]PoolTeamID[/B] and [B]TeamName[/B] The PlayerStats table … | |
HI. I'm new to this forum and new to C++ programming so be kind !! I've got a program that reads in a batch load of tif files works on them one at a time and then outputs the files as .png. Problem l have is that the tif filenames … | |
I'm writing a program which prompts the user to enter a sentence and then prompt the user to enter a single letter of the alphabet (into a char value). It's also supposed to count and display the number of words containing the letter entered (not case sensitive) and the total … | |
Hello DaniWeb community! I come to you in need of some guidance on a quite frustrating problem. In a nutshell, I am building a java system in which users can keep track of weather forecasts at a list of registered locations, which they can add or remove from their "watchlist". … | |
Hi all, I'm working on a program for my data handling class and I have a quick question. I'm trying to write a method that prints a range of elements in an array. I have written it in such a way that I create a new, smaller array with the … | |
How do you change the size of a listview when the number of rows grow when a different where select is commanded on textchange. I have a textchange on coustomer name which fills the listview with just the names that start with the letters as they are typed in, this … | |
i am trying to create a massive list of letters and numbers using this program. but for some reason i keep getting an error (sometimes this occurs, sometimes it doesn't) [B]error PRJ0002 : Error result 31 returned from 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\mt.exe'.[/B] i also get(sometimes this occurs, sometimes it doesn't) [B]Unhandled … | |
Im trying to add up 100 grades and get the averge but it wont compile because it "cannot convert from 'int' to 'int [100]. Can anyone help me?? [CODE] #include "stdafx.h" #include <iostream> using namespace std; int main() { int total, j; double average; int grade[100]= (56,97,73,59,68,79,86,67,79,66, 95,64,98,56,79,83,75,89,73,91, 52,72,63,81,62,85,37,78,100,89, 56,89,75,76,99,66,84,98,68,59, … | |
I created 100 pictures boxes for my game with this code : [CODE] for (int p = 0; p <= 9; p++) { for (int o = 0; o <= 9; o++) { picsBoard[p, o] = new PictureBox(); picsBoard[p, o].Name = "emptyPicBox" + p.ToString() + "." + o.ToString(); picsBoard[p, o].Location … | |
Hi, I am looking for a way to use minimal javascript to open a popup window when the user clicks on an input field and allow them to choose one string inside the pop up window (like click on a radio button) and get the input box in the parent … | |
hello I would like to know if it is possible to store an array within a structure. For examples for recording people with more than one name. Like this: Structure Product_Reccord Dim PNames(3) as string end structure It is giving me an error, help please!! | |
I'm definitely a noob to rails so sorry if this is trivial. I have tables with associations on them. The associations are supposed to add methods to my models like model.others and model.others= and so on but when I try to use them I get errors like the following. NoMethodError: … | |
hi, can someone please tell me the approach i should take to find the distinct substrings of a string ? | |
I'm supposed to allow the user to draw shapes based on their combobox choices (eg. line, rectangle, circle), colour, fill state, etc. However, nothing is showing up. Model class: [CODE]import java.awt.Color; import java.awt.Graphics; import javax.swing.JPanel; import javax.swing.JLabel; import javax.swing.JOptionPane; import java.awt.event.MouseAdapter; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.event.MouseEvent; public class DrawPanel … | |
this is my code for a simple link list...i cant solve the problem of the while loop.it is only working for "1".and i cant swap two nodes in the list and cant insert nodes in a given position...how can i do those???plz help....[CODE]//Pirate™ #include<stdio.h> #include<string.h> #include<stdlib.h> struct list_element { char … | |
hello all in table1 I have Date Value 2/1/2010 100 2/2/2010 110 2/5/2010 95 3/4/2010 150 3/15/2010 220 etc how to sum the value according to it's month ? so I got Pebruary' sum value=315 March sum value =370 tq | |
hi .. i wanna read text file in binary format ... 4 ex : lele and raz ..."in text file " l=10011001 e= 011110011 ..... "cmd (8 bit per letter)" and but them in an array ...i tried the type StringBuilder but it didnt work ... i need a method … | |
Hi, I'm new to Java and am having a problem getting my program to run, any help would be greatly appreciated. Here is the program: [CODE]//This program displays a message asking the user if they //want to know the Top Premiership Players. If they say Yes, //they will then be … | |
Hi, I try to convert a tuple into binary number but I keep getting the error like"ord() expected string of length 1 but tuple found" Can anyone help me in this? | |
I have created a few applications in MFC. But I want to start saving the contents of them to files(just like word,guitar pro or paint). I tried serialization provided by MFC but I didn't like it that much because I couldn't check anything that was saved at all. So,I wrote … | |
Hi, I'm having trouble understanding how I should use pure virtual functions in my inheritance tree. I've drawn a class diagram which shows what I'm trying to achieve: [img]http://i42.tinypic.com/2qjdttd.jpg[/img] Here is what I've written: [B]main.cpp[/B] [code] #include <iostream> #include <string> #include <list> #include "base.h" using namespace std; int main() { … | |
first i had partioned my array into two subarrays. Then the quick sort switches to insertion sort for sorting the small sized subarrays. But the error is logic error, because when i enter 15 inputs, the first and the last inputs are not sorted at all..I think error is in … | |
Hi, i didn't know whether to put this under C or Shell scripting so i chose this one. Well I am doing a piece of shell scripting and have written some code. and basically when i run it no prompt shows up so i cannot type commands like help or … | |
I'm creating a program that maintains a log file. The file is created at the start up of the program and appended to throughout the run. This works perfectly fine, but I went and manually added the program to run at start up in the registry. The program runs as … | |
I am using char * for getting data from the user. Now, if i just do [CODE=C++] char * data = new char[100]; cin >> data; [/CODE] The data is corrupted, i.e. only data before whitespace is stored; and the following is an example result: [CODE] enter: "Microsoft Co." data: … | |
So i guess the titles says it all i m trying to create dynamic structure of adjacency lists and i m having some errors since i m a little new in C anyone mind taking a look at it and tell me of any mistakes i might be doing STRUCTURES … | |
Hi, i've problem with reading arguments on command line. I don't know, how do I distinguish, if the user entered some argument with one or two dashes. I try: [code] while($ARGV[$i]) { if($ARGV[$i] == '--anything') { print "The argument with '--'.\n"; } else { print "The argumentwith '-'.\n"; } $i++; … | |
sir i have no idea about the graphical work in c...bt i want to learn those things...how can i learn?????plz show me some way.. | |
Hi all, I'm new to this community. I am doing a project that I'd have to write a program to connect 2(at least) PCs together. each PC works as a server and at the same time as a client, which each of them can download the file which is shared … | |
Dear all, I have to use a funny structure in my code which has a 2D array and allocate it in the program. I do not know how to use malloc for that. This is the code: #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define NUMBER_DECISION_VARIABLES (int)4 #define DIM … | |
Hi, Im new to java and was wondering if someone could help me with my problem. Im writing a program which will calculate how long a journey will take, the user will need to enter a character to represent what type of road/speed they are doing and how long the … | |
hy im having a little problem with a loop with jgrasp here is my basic program [code] import javax.swing.JOptionPane; public class loops1 { public static void main (String[]args) { String name do { String name = JOptionPane.showInputDialog ("who is the cleverest person in the room?"); } while (name != "erin"); … | |
import java.io.*; public class EggTrader { public static void main(String[]args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int numofEggs,EggCount,Cash; double cashOnHand = 500; double pricePerdozen = 72; double unitPrice; public void buyOneDozen(double pricePerdozen) { numofEggs = Integer.parseInt(br.readLine()); numofEggs = getEggCount(numEggs,cashOnHand); } public void sellEggs(int numEggs,double unitPrice) { numofEggs = … |
The End.