199,114 Archived Topics
Remove Filter ![]() | |
Hey, guys I think this is a very simple problem and that I just can't get it is due to some gap in my knowledge. Any way, what is wrong with this : [CODE] class A{ private: int value; public : A(int v); }; A::A(int v) {value = v;} //Does … | |
[code=cplusplus]#include <iostream> using namespace std; #define PRINT(x) cout << #x " = " << x << endl; class Object{ public: Object():i(5){} int i;; }; int main() { Object o; o.i = 5; int* p = &(o.i); PRINT(*p); int Object::* p2m = &Object::i; PRINT(o.*p2m); return 0; }[/code] the two PRINT macros … | |
I've been studying enums lately and decided to make a program with it to test the enum syntax and my first one worked. It was: [code=c++] #include<iostream> using namespace std; int main() { enum daysinweek{ monday=0, tuesday=1, }; enum daysinweek enumerator=monday; cout<<enumerator<<endl; system("pause"); return 0; } [/code] It worked perfectly, … | |
I put together a simple color chooser and havce one other thing I want to accomplish but can't figure out. I want the individual scrollbar to change color to reflect the amount of that particular color ie red (255,0,0) Also, in playing with this I have realized that it is … | |
Hi all, I'm a beginner at Open Watcom and i'm trying to R/W from and into a file...i used the library "fstream.h" but the scanner shows invalid token... [code] #include <stdio.h> #include <string.h> #include <iostream.h> #include <fstream.h> int main() { ifstream inFile; // object for reading from a file ofstream … | |
I am a fairly new programmer with limited knowledge in C++. I am currently writing a program for my class that involves fractions. I was doing good writing one piece at a time and making it work until the instructor threw a wrench into my plans and asked me to … | |
[CODE] // Description: This is a computer version of the game hangman, the user // can play against a 2nd player or the computer, and he can enter how many // guesses he gets, // // Start of program // Header file definitions #include <iostream> // Standard input/output #include <string> … | |
Ok, working on a program to find the shortest path between two points. Simple. Now, we are going to be given a list like this to denote the start and end, and then the weight of the lines. [code]A D B C 31 B A 4 C A 12 C … | |
i m new 2 programming so could anyone help me or give me a idea 2 how develop examination management system in C wat features should i aad 2 it before making a program of that | |
How do I disable and Enable Menu Items and Sub Items. [code]if(Selected == "drum" || Selected == "guitar" || Selected == "mic" || Selected == "computer" || Selected == "car" || Selected == "hockey" || Selected == "laptop" || Selected == "watch" ) { pCmdUI->Enable(Sort == 1); }[/code] The above … | |
hi. plz help with reading encrypted binary files in C. thx. | |
Hello Everyone, I have a terrible problem with data structures in C. i have defined a structure as below: struct MNT { char label[32],opcode[32],operand1[32],operand2[32]; struct MNT *next; }; typedef strct MNT *MNTABPTR; MNTABPTR mnt_first = NULL; and for allocating memory i used the following sentence: MNTABPTR newnode; newnode = (MNTABPTR)malloc(sizeof(MNTABPTR)); … | |
H! I have to write a program for sorting two dimensional array(e.g. Matrix) without converting it into a single dimensional array or using pointer concept. So, can u please give me any idea for writing this program? | |
Sorry all, this is probably an asked question already, but can't seem to find it. I have designed and uploaded a website for a company. Static pages (3) with a simple form using php to direct the form to one of the companies e-mails. I now need a members log-in … | |
Im trying to write a script that can return directions to an address from google. I've looked over urllib for a while and I cannot figure out how to send the information to the server and then retrieve the directions.. any ideas? | |
I encode a text file using a huffman tree. Which print out to the screen and and output to a file. File only contains the last line that prints to the console. [code]void traverse(string code = "") const { string outputFile = "huffman.txt"; ofstream outfile(outputFile.c_str()); if (child0 !=NULL) { static_cast<huffman_item<dtype> … | |
Is keil software for programming microcontrollers a free tool, or does it need to be purchased with a license? Thanks. | |
im creating a java program using Jgrasp and im completely stuck on how to apply my random operator to calculate two random numbers? heres my code: //Import Random Generator import java.util.Random; import java.util.*; //Program name class TimesTableTestTimer {//open main public static void main(String[] args) {//Create while loop to restart char … | |
Hi to all! I never used Pointer Functions, and now i'm trying to use a C Pointer Function in Visual Studio 2005. But there's a problem... the pointer function isn't working properly... This kind of functions doesn't work in the same way in C and in C++? My pointer function … | |
hey people, I want to develop my own social network. Do you think PHP and Mysql plus Javascript can do the magic?........ Thanks in advance..... | |
I've a simple question, i wonna make a program using access database to store the entered data and making some calculations on it to get the total income per day and per week, how could i backup the old data and save it in a separate database at the runtime … | |
Hi, I have a simple code written in MIPS assembly that reads an integer from a user and displays it to the screen. The code is as follows: [code] main: la $a0, in_msg li $v0, 4 syscall li $v0, 5 syscall move $t0, $v0 la $a0, out_msg li $v0, 4 … | |
hi everyone.. i have a small problem with the below code.. when i execute the program, the output file doesnt print me the unsortedList.ReturnLastItem().Print(); it gives me the following output: the last item in the unsortedList is how can i make it print me the last item? here is the … | |
Hi All, I have a bit detailed question. So, please be kind enough to take few minutes and give me an advice. Currently, we have an ASP.NET based Invoice engine application. It basically handles the customer details with their invoice details. One of our client told us that he cannot … | |
i have multiple onchange in two different form and they are in different include files. the thing is when i try to use the first onchange ...it works and it will change the session value but if i start with second onchange it will not work and it says the … | |
hello guys, i know all of you are gurus at this as for i am a rookie, i am currently using MySQL 2000 and i would like to retreive information from the database from a certain table via an HTML website what are the scripts that i could run to … | |
I want to do something like this: unsigned char r[3] = {255, 0, 0}; map<unsigned char[3], int> ColorList; ColorList[r] = 1; But I get the following: error: array used as initializer How else would I set the r element of the map? Thanks, Dave | |
I'm trying to put together a registration form for little league baseball. I'd like to have a form where the parents can enter their information and the information for up to 5 children. I need a separate record for each player instead to one record for each family. So what … | |
Good day. I wanted to share with you the code for an application I've created. It can read the number of pages in all the PDF files from one directory. The question I have is this : does it need more optimisation ? Can I make it work faster ? … | |
Hi there, new programmer/python user here. What I'm trying to do, is simulate the rules of a tabletop RPG (not nerdy in the slightest). This is using a 10-sided die. In the game when you roll a 10 the dice "explodes" and you roll it again and add the next … | |
Hi there, been having some trouble with a simple program i am trying to write. I'm fairly new to C++, and can't seem to fix the errors im getting. Any ideas or hints would be much appreciated. [code=c++]#include <iostream> using namespace std; int main() { double payrate; double hours; double … | |
Good day, I like so many, am new Perl. I am trying to search a file for a string, if found, pass it to an array. I don't think what I have done is the best way of doing things, but I learn by getting scripts to work and them … | |
I need help with joining these two tables: Table1 idx idy --------- one 1 two 2 tree 3 Table2 idy u ------- 1 a 2 b 3 c 4 d 5 e 6 f I want to show rows from the Table1 that have idx=one joined with all the rows … | |
Hello all. I am having some questions about a subject. I am running a small social community using SocialEngine and i want to include phpbb3 with an arcade mod or any arcade board that support high scores. My problem is that i do not want my users to re-register into … | |
i have a jsp it has two fileds..mobileno and password..when i enterd values its storing in DB.But when iam retriving its retriving and comparing only with newly inserted values only.. it is comparing only last inserted values in Db only ..here is my code.. package com; import java.io.*; import java.util.*; … | |
I want to fetch data from Mysql database in list box..but it's not happening The code is: [code=php]<?php include("connection.php"); $sql= "select student_age from student_data"; $result= mysql_query($sql); if(!$result) { die('could not connect:'.mysql_error()); } while($row = mysql_fetch_array($result)) { echo "anumita"; ?> <option value="<?=$row[0]?>"> <?=$row[0]?> </option> <?php } ?>[/code] | |
Hello all I need fast answer on this: How i can change(or) reset value ["referalvisits"] to ZERO? let's say that there is some value: for example 23220 I need reset it to zero and count again from zero.. "" [code=php]<th>Referral Visits</th> <td> <? echo $row["referalvisits"]; ?></td>[/code] "" thank you alot I … | |
hope someone can help me with this. i am trying to update records in a mysql db with a new image but i keep gettin errors. i am using a hidden form input to post a variable across to a new page, i can echo the variable out at the … | |
Hi.. I am using downloaded code from google it create frame when we upload image. i am modified that code .. I want like when uploaded new image 1> previous image is deleted or new image is overload on previous image in Same frame but problem is when new image … | |
Hi there, So I thought this would be simple and it should be but I can't see what is wrong. Basically I am checking what language has been selected (via a code stored in a constant LANG_CODE) and then loading in a specific swf file. Except that the language code … | |
hello guys, Im trying to understand how fread and fwrite works. My teacher said that these functions can store/output binaries and texts in files. I know how to do it with string. Im confused with floats and integers. I tried to make a program for it but Im getting errors. … | |
[CODE]// file: hangman.cpp // name: Kyle Burmark // professor: M. Gelotte // date: 2/26/02 // Description: This is a computer version of the game hangman, the user // can play against a 2nd player or the computer, and he can enter how many // guesses he gets, // // Start … | |
[code] if (window.print) { document.write('<form>Click Here To ' + '<input type=button name=print value="Print" ' + 'onClick="javascript:window.print()"> This Page!</form>'); } [/code] using this code the whole page is printed can I limit the paper size? also can I remove the print header and footer? Thanks in advance. | |
wen i try to connect jsp with access i found error showin "no data found" ..how can correct it ? also data is not inserted in my database..my codin is below.. [code=JSP]<% Connection con = null; Statement stmt = null; ResultSet rs = null; String quer = "insert into db … | |
I am creating a login page , where when user enters his username and password the the request is sent to the servlets first and then validation is done in a javabean . If validation results true then user is forworded to another page otherwise he remains on the same … | |
Hello I'm making a wabsite with a gridview(so far..) but,when i try to fill with a dataset ...nothing ,i can't see no data and my dataset is never empty ,it contains data .I ran some debugs and the dataset reads correctly from the sql server database here's the code [CODE] … | |
I'm trying to sending Email through my web application from Gmail by using Sustem.Net.Mail.SmtpClient My code is [CODE] string To = "doctor_ofvet@yahoo.com"; string From = "doctorofvet@gmail.com"; string Subject = "The Famous"; string Body = "Hello World"; SmtpClient Client = new SmtpClient(); Client.Send(From, To, Subject, Body); [/CODE] I put this code … | |
I've made a program using gcc as a compiler. In my loops I've been using a uint type as the type of my loop variable. But now it seems that some systems doesn't support this type. Can I make a preprocessor conditional that does a #define uint to unsigned int … | |
Hey all, I need some help with an application which needs to read data into an array using methods and then write it back out into a 5x5 table so i would read int 25 digits say: 0 1 2 3 4 5 6 7 8 9 0 1 2 … | |
#include<fstream.h> #include<iomanip.h> #include<conio.h> #include<iostream.h> #include<stdlib.h> #include<string.h> #include<time.h> #include<iomanip.h> //-----------------------------------------------------------------\par \par \par class inventory\par \{\par \tab char name[25];\par \tab int code,copy;\par \tab float cost;\par \tab char stock[3];\par \tab char datestr[9];\par \tab char timestr[9];\par \par \tab public:\par \tab\tab void rdata(void);\par \tab\tab void wdata(void);\par \tab\tab void menu(void);\par \tab\tab void display(void);\par \tab\tab void mainpage(void);\par … |
The End.