199,114 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for ichigo_cool

I'm working on a program to save and load character files for a text-based RPG. There are three slots to save to. I'm having the user enter whichever slot he wants to save to through inputting an integer. If the number is lower than 1 or higher than 3 I …

Member Avatar for ichigo_cool
0
111
Member Avatar for jelinky

My program reads water temperatures from a river as well as when the temps were recorded from an input file called "biodata.dat." Then the data is outputted in a file called "results.dat" (i havent added this results.dat part in my code but do know how to do it) The input …

Member Avatar for jelinky
0
95
Member Avatar for koveras vehcna

Hello everyone, I'm working on a random text generator -without using Markov chains- and currently it works without too many problems -actually generates a good amount of random sentences by my criteria but I want to make it even more accurate to prevent as many sentence repeats as possible-. Firstly, …

Member Avatar for TrustyTony
0
135
Member Avatar for MareoRaft

Here is a simple program which gives me unexpected results: [code=c]int main() { printf("\nTo calculate a^b, enter value a now.\n"); int a = getchar() - '0'; printf("\nEnter b now.\n"); int b = getchar() - '0'; printf("a = %d, b = %d\n\n", a, b); return 0; }[/code] if i hit a …

Member Avatar for MareoRaft
0
3K
Member Avatar for shahzaib g

[I]plz tell me how can i make software of calculator in c++. from smartboy shahzaib[/I]

Member Avatar for NicAx64
0
86
Member Avatar for CzechRock3

So I am programming a binary to decimal conversion program... But the twist is, I want to Convert my input string to a const char, and from the const char I want to convert it to an integer... Because I can not just convert a string directly to a integer. …

Member Avatar for CzechRock3
0
403
Member Avatar for 344server

Hello List, I'm creating a Button where I want to add a function setActionOnReleased(func aFunction); From any class I'd like to instantiate this Button class and send it the function I want to execute. I found some reference to using member function pointers ( [url]http://bytes.com/topic/c/answers/569262-passing-function-argument[/url] ), but I'd like to …

Member Avatar for 344server
0
257
Member Avatar for Korakos

Hello! I have i problem i was hoping you could help me with, I have to write a script that will ask the user for a username and password, and validate it through /etc/passwd and /etc/shadow. I've looked all over the place for an answer to this and i just …

Member Avatar for Korakos
0
255
Member Avatar for EvolutionFallen

Ok I feel like this may be a dumb question, but I'm putting it out there anyway. It's been a while since I've worked with C++. What characters does C++ print for negative values of char? Positive values seem to follow ASCII, but ASCII is only 128 characters. So where …

Member Avatar for EvolutionFallen
0
110
Member Avatar for glenak

Hi, this is a very strange problem for me. I'm writing an app that uses the BouncyCastle API. I downloaded the jar file from their website and I put it in my project build path so as to use it, and it works. However, when I try to run the …

Member Avatar for NormR1
0
9K
Member Avatar for fuggles

I am using the Direct2D API to draw some graphics for my program. I have a function that I call every time the Window redraws that draws the frame. I can't hardcode every object to be drawn into the function, if I want it to be dynamic. What is the …

Member Avatar for mike_2000_17
0
100
Member Avatar for maestro2010

Hi i am new to this language and want some help on how code for playing media player or avi player using xml and php a web page along with full controls (forward,stop,pause,play etc). youtube vedios are easy to play on a web page using <embed></embed>

Member Avatar for 84hd0ns
0
112
Member Avatar for neo_31591

readLine() returns string type.... i have a file of usernames and passwords and am trying to check the username as when entered into login page..... [code=java] InputStreamReader i1=new InputStreamReader(new FileInputStream("usr")); BufferedReader b=new BufferedReader(i1); String str; str=b.readLine(); for(int i=0;i<str.length;i++) if(str[i]==("USERNAME: "+Login.usr)) { bool=true; } [/code] now i know im trying to …

Member Avatar for JamesCherrill
0
102
Member Avatar for coolboss

#include<iostream> using namespace std; void main() { int pro[100]; for(int a=100;a>=1;a--) { pro[a]=a; cout<<pro[a]<<"\t";} }

Member Avatar for arkoenig
0
117
Member Avatar for gisek

Hi, After a year of using c# and gaining object programming experience I decided to improve my c++ skills. What I particularly liked about c# was the way of dividing source into different files. It all just worked fine :). Now I want to do the same using c++. I'm …

Member Avatar for gisek
0
139
Member Avatar for rowley4

I need to write an Array List of Pets. An item list is either a Dog or a Cat. For each pet enter a name and type (C for cat or D for dog). Input should stop when the word STOP is entered for the name. I need to also …

Member Avatar for NormR1
0
2K
Member Avatar for BboyRodimus

Here's the prompt guys: Assignment #4 will be the construction of 2 new classes and a driver program (the class containing a main method). [B]Address class[/B] The Address class describes cpu of a bank. It has following attributes: Attribute name Attribute type Description city String the city of the bank …

Member Avatar for NormR1
0
279
Member Avatar for koveras vehcna

Hello everyone, I'm working on a random text generator -without using Markov chains- and currently it works without too many problems. Firstly, here is my code flow: 1-Enter a sentence as input -this is called trigger string, is assigned to a variable- 2-Get longest word in trigger string 3-Search all …

Member Avatar for koveras vehcna
0
176
Member Avatar for Megha SR
Member Avatar for Xufyan
0
117
Member Avatar for Shaaani

i wanna ask another thing i have created an applet which has one main file and 7 other class files now i want to connect it to database the following code is in class file on compiling it gives access control exception... [code]private boolean spellCheck(String spell) { Connection Conn; Statement …

Member Avatar for peter_budo
0
110
Member Avatar for badenpearce

Hi, I'm an experienced developer but not done much in c++ and wanted to get some basic database operations in my program, open, store, retrieve etc. Does anyone have any good links that could get me started? Thanks Baden

Member Avatar for Stefano Mtangoo
0
375
Member Avatar for lewashby

I just got postgresql & pgAdmin III up and running. I'M trying to start the book "Simply SQL" so how do I go about getting to .sql files for the book into pgAdmin? Thanks for any and all replies.

Member Avatar for lewashby
0
162
Member Avatar for koykemar

I am trying to create a music web player that changes song automatically, however the song is instead repeated and whenever next is click, and some codes are executed to stop the current song and start the next, the current song pauses for about 1 sec instead... can some please …

0
86
Member Avatar for Megha SR

hello. i have done the followinh program to convert a String value to a double value.when i am compiling this program, i get an error as"unclosed character literal in the 18th line.can anyone say what's the problem? import java.io.*; class strin { public static String a(String s); { String j=""; …

Member Avatar for jon.kiparsky
0
125
Member Avatar for NewOrder

i know what an interface is. but i dont understand what the use of connecting the objective reference to the interface method and then use it to implement.. could someone explain to me the code..whats going on/ [CODE] interface TextReceiver { void receiveText( String text ); } class TickerTape implements …

Member Avatar for NewOrder
0
119
Member Avatar for Kadafiz

[CODE=PHP]<select name="item8" id="item8" onchange="getPrice(this.id)" /> <option value="" >Select here</option> <?php $sql = "SELECT ItemID, ItemName, Price FROM itemavail ORDER BY ItemName"; $rs = mysql_query($sql); while($row = mysql_fetch_array($rs)) { echo "<option value=\"".$row['Price']."\">".$row['ItemName']."\n "; } ?> </span> </div> </select>[/CODE] im using this code to make selection field. Here i want to get …

Member Avatar for Kadafiz
0
180
Member Avatar for SunnySideUp

Hi, I am looking to be able to display errors from my forms or whether the email address is already taken on the same page. My script is shown below: [CODE] if(isset($_POST['subregister'])) { require_once('../sign-up/recaptchalib.php'); $privatekey = "Hidden"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { // What happens …

Member Avatar for Stefano Mtangoo
0
161
Member Avatar for keavon

First of all, please check out my other post. [url]http://www.daniweb.com/forums/post1318472.html#post1318472[/url] Ok, hello everybody! I have a question that should be pretty simple. I have a php page that will send an email. I got that all working fine. [CODE] <?php $to = "reciever@example.com"; $subject = "Test Subject"; $body = "Test …

Member Avatar for keavon
0
1K
Member Avatar for MDanz

how do i run a query for a variable with multiple values? i've been told a loop is not the right way to do it, which is the way i've been doing it and it has worked. I assumed putting it in a foreach loop would accomplish looping the query …

Member Avatar for mwasif
0
160
Member Avatar for jakesee

Hi, I am currently trying to do a website with both chinese and englis text, and I have problems displaying chinese text. I uploaded a set of identical website files to 2 different servers and domains, and one displays chinese character but has messed up layout, the other does not …

Member Avatar for jakesee
0
174
Member Avatar for saransh60

#include<iostream> using namespace std; class alpha{ private: int data; public: alpha(){} alpha(int a){data=a;} void display(){ cout<<data; } alpha operator =(alpha& a){ cout<<data; data=a.data; cout<<"\n assignement operator invoked"; return alpha(data); // is temporary object created is returned to a2 object ?//why it can't be returned by reference?what is the difference b/w …

Member Avatar for Narue
0
116
Member Avatar for glenak

Ok, I'm really confused here. I know that the only way to transfer objects via input/output streams is if they are serialised. If i wanted to transfer objects of my Person class from my client to server, I would have to implement "serializable" in my Person class. That's all well …

Member Avatar for glenak
0
138
Member Avatar for James0l9l

I'm brand new to coding and python. Could someone tell me what is wrong with my code? [CODE] def getlist(): lst=[] answer1 = raw_input ("Would you like to add a number to create your mean value? y/n") if (answer1 == "y"): x = input ("Your number:") lst = lst + …

Member Avatar for TrustyTony
0
123
Member Avatar for watz_uph

hi all, i have a little issue with SUM query from this table UNIQUEID Date Production engine1 01/12/1999 1440 engine1 01/01/2000 6061 engine1 01/02/2000 5152 engine1 01/03/2000 5347 engine1 01/04/2000 4642 engine1 01/05/2000 5264 engine1 01/06/2000 5247 engine2 01/07/1995 561 engine2 01/08/1995 3066 engine2 01/09/1995 2133 engine2 01/10/1995 2282 engine2 …

Member Avatar for watz_uph
0
129
Member Avatar for ceeandcee

As you can see from this page: [url]http://www.cornwallfantasyhockey.com/cfhl/schedule3/[/url] I have created an output table of 11 players. I would now like to total the GP and PTS column. Here is what I have so far: any thoughts? [code] <?php $result = mysql_query("SELECT * FROM stats1011 where 1A = 'BULL' OR …

Member Avatar for ceeandcee
0
104
Member Avatar for newprimitive

Hello, In OOP PHP, i got 2 classes: Database and News. In News class i call DB function and get result (multidimensional 2D array). Now i have to display that array in index.php. I call News class (lets say get_news() function) from index.php but cant retrieve data and always get …

Member Avatar for Stefano Mtangoo
0
155
Member Avatar for Shaaani

Here is the code... Problem is that it shows a message retCode is not initialized if i written last line in try block it shows return error i dun understand wat to do now plz friends help me private boolean spellCheck(String spell) { Connection Conn; Statement Stat; ResultSet Rs; String …

Member Avatar for NormR1
0
124
Member Avatar for y2kshane

can i declare operator overloading function as a friend function? i did it and i get errors #include <iostream.h> class time { int h; int m; friend time operator +(time); public: void input(); time(); time(int,int); void display(); }; time::time() { h=0; m=0; } time::time(int a,int b) { h=a; m=b; } …

Member Avatar for Stefano Mtangoo
0
293
Member Avatar for apachex

[COLOR="Green"]ERROR : [/COLOR] [COLOR="Red"] System.Data.SqlClient.SqlException: Implicit conversion from data type sql_variant to uniqueidentifier is not allowed. Use the CONVERT function to run this query. [/COLOR] I made a admin side for editing roles and user passwords if necessary.. But since the default ASPNETDB,mdf have UserID and Password in 'Unique Identifier' …

Member Avatar for blackdragon1027
0
151
Member Avatar for DaveTran

I've created an algorithm that draws a 2D grid in the most efficient way I could think of. Suggestions to improve it are encouraged though :) [CODE] public void DrawWireGrid(int xDivisions, int yDivisions, int cellSize, Color color) { Vector3 a = new Vector3(); Vector3 b = new Vector3(); for (int …

Member Avatar for DaveTran
0
112
Member Avatar for PhilEaton

The point of this script, is to take the user input (a website) and turn it into it's IP address. This then is turned into a file, readable later in the script. This is my attempt at having these sites available theoretically forever. A collection of what everyone has searched …

Member Avatar for sithembisophp
0
201
Member Avatar for n.utiu

Few days ago I finished making my own (quite primitive) chat server with SocketServer. I haven't had any problems with it apart from the designing of the chat protocol: I made a very sketchy protocol for messaging. The client just sent unix-like commands to the server to do certain opperations: …

Member Avatar for n.utiu
0
115
Member Avatar for srivardhanms

[code] #include <iostream> #include <fstream> #include <string.h> #include <ctype.h> const int SIZE=100; using namespace std; class Person { private: char name[30],address[50],phone[11]; public: friend ostream &operator << (ostream &os, Person &p); friend istream &operator >> (istream &is, Person &p); friend ofstream &operator << (ofstream &fos, Person &p); friend ifstream &operator >>(ifstream …

Member Avatar for mike_2000_17
0
2K
Member Avatar for newbie_to_cpp

Hi All, I am new to C++. I am practicing loops and i need some help. This one behaves strangely. What i want is for this loop to accept numbers from 1 to 4 for options (strictly numbers) and no other characters. When executed and run, if the input is …

Member Avatar for ceriamultimedia
0
102
Member Avatar for facarroll

Hi. I'm no expert here, and I need some help. This form does not update the database. I know it is accessing the database because the checkbox and radio buttons variables are good, but there is no result posted. Can anyone tell me what is wrong here. [code=php]<?php session_start(); // …

Member Avatar for facarroll
0
139
Member Avatar for valter

This has started happening when I run my project, the code that triggers this is simply if I enable or make visible a toolstripmenuitem. I have no idea what this is alluding to or how to stop it. If I rem the lines out, it simply happens with the next …

Member Avatar for valter
0
113
Member Avatar for rayden150

I was wondering if i could incorporate swing, into the code to create a GUI?: [CODE]public class ComputerMerchandise { public static void main(String[] args) { java.util.Hashtable<Integer, Product> htProducts = new java.util.Hashtable<Integer, Product>(); for(Product product:Products.GetAllAvailableProduct()) { htProducts.put(product.getProductId(),product); System.out.println(product.toString()); } Hashtable<Integer,Integer> orders = new Hashtable<Integer,Integer>(); java.util.Scanner scanner = new Scanner(System.in); while(true) { …

Member Avatar for tong1
0
191
Member Avatar for BboyRodimus

I'm writing two classes for the main program code. I'm stuck trying to do figure out how to instantiate an object of the class Address: [B]Address class:[/B] [CODE]public class Address { private String city; private String state; public Address() { city = "?"; state = "?"; } public Address(String aCity, …

Member Avatar for sneaker
0
1K
Member Avatar for skshoyeb

Let me tell u, that I AM A NEWBIE to C++.. I want to use sound in C++ (I use Borland Turbo C++ 4.5 because, this is used in our college..) To use sound files, I browsed net and came to know that we may play sound using the sound(), …

Member Avatar for skshoyeb
0
499
Member Avatar for AutoC

Hi. I have a character array of the form "0abcdef" or "1defghi". I have to remove the first character and convert the rest to a string. So in this case, the strings would be abcdef and defghi. I know that saying string s(char array) does a direct conversion but I …

Member Avatar for AutoC
0
239

The End.