199,114 Archived Topics
Remove Filter ![]() | |
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 … | |
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 … | |
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, … | |
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 … | |
[I]plz tell me how can i make software of calculator in c++. from smartboy shahzaib[/I] | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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> | |
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 … | |
#include<iostream> using namespace std; void main() { int pro[100]; for(int a=100;a>=1;a--) { pro[a]=a; cout<<pro[a]<<"\t";} } | |
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 … | |
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 … | |
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 … | |
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 … | |
can anyone explain to me about what actually is a constructor? | |
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 … | |
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 | |
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. | |
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 … | |
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=""; … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
#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 … | |
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 … | |
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 + … | |
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 … | |
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 … | |
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 … | |
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 … | |
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; } … | |
[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' … | |
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 … | |
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 … | |
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: … | |
[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 … | |
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 … | |
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(); // … | |
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 … | |
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) { … | |
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, … | |
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(), … | |
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 … |
The End.