49,761 Topics
| |
How would I do this [CODE] class test { public: int* num; }; int main() { test *d = new test; d->num = new int; d->*num = 3; cout << d->*num; } [/CODE] | |
I've a question on dynamic memory. As i understand it, i can create a dynamic memory array using: xxx= new int [z]; Then I can set the value of 'z' to be whatever value i want during the program. But if i create a dynamic memory array using a predefined … | |
x*y = a + b*lcm(x,y) + c*gcd(x,y) I have to solve this eqaution.How to make a solution for it. here a,b,c<=10^6 Any suggestions | |
Question: So basically using the class below I want to create polynomials as can be seen in the example: Command: s Set coefficient. Give A n c: x 3 33.33 Command: o Output poly. Give A: x Polynomial x: 0x^0 + 0x^1 + 0x^2 + 33.33x^3 Command: s Set coefficient. … | |
Hello I'm working on a project, and I have the following classes: [LIST] [*]Loader - This loads the contents of the text file [*]Matrix - This processes the data that has been loaded [/LIST] Now I'm using association, Loader -> Matrix In my matrix class I have a method that … | |
let say, i have a House object; House* someHouses = new House[100]; -----fucntion call... may or may not add stuff to someHouses ------ now, i want to get to the last position that haven't used yet. i tried to check NULL, and 0, both doesn't work. how can i check … | |
Is this a viable BIGENDIAN test: [CODE]int tmpvaluethatwillneverreallybeused=1; bool bigendian=(*(char*)(&tmpvaluethatwillneverreallybeused)==1); void myFunction() { if (bigendian) { //do big endian specific code } else { //do little-endian specific code } }[/CODE] | |
Basically, the assignment is to create a huge integer class by using a singly linked list, wherein each element of the linked list holds one digit of the number of the huge int. I only have to do addition and multiplication, and addition works. Multiplication *should* work, as far as … | |
Hello friends...I'm having confusion about binary operator overloading in the following program. The question goes like this. Qn. Create a class time with two member variables as hours and minutes of integer type,write default,parameterized and copy constructor. Overload necessary operators to compute T3=5+T1+T2, where T1,T2 and T3 are time objects. … | |
Hello, about 3 months ago I made simple chat using MySQL++ which is working fine, login function: [url]http://pastebin.com/Mdup4zi6[/url] but today I'm creating Control Panel, I've copied and changed this function a little bit, but i'm getting 0 results (if I copy syntax to navicat I'll get password so...) login function: … | |
Hello, I am trying to read data from a file and make each saved item in the file an option on the combobox so that the user can select whatever he wants .The problem is in adding items to combobox not in reading from file .can anybody help me plz … | |
Hi guys, the title says it all, I have produced list of numbers from a c++ program into an excel file, and I want to make a CDF graph out of it. What I know is that I need to find numbers greater than zero, then number greater than one … | |
Hello everybody, I am still learning c++,I already know about objects, classes, pointers and i can use them. I wanna move to game development, but should I go further in console apps before moving to game dev ? Please help me because i am 14 years old and i would … | |
hi.. this is part of an assignment.. but any help will be greatly appreciated F(0) = 0 where F(z) is a linear polynomial of order n with complex coefficients F(z) = A(n)Z^n + A(n-1)Z^n-1 + ... + A(1) Z + A(0) = 0 this hasent formatted very well.. it's A(subscript … | |
hi! What is makefile? How does it work? Is it done in the terminal? I am using Unix OS | |
Good day to everyone. I have this trouble of stopping the timer at a specific time, say I have to stop the timer at 1:30. When I try to run it, it doesn't stop. Please help. Here's my C++ code. [CODE] #include <iostream> #include <time.h> using namespace std; void wait … | |
I am using a priority_queue-s for implementing A* and Dijkstra's algorithm. Is there a point writing my own heap for time optimization? How faster would it be? I read in wikipedia that Fibonacci heap will be the best. Do you agree? | |
Greetings, this is my first post here but I will try to do it correctly. I know this specific question is a common one, but I am not looking for someone to do it for me, I just need someone to help me out a little. I understand the basics … | |
i watched this tutorial video [url]http://thenewboston.org/watch.php?cat=14&number=13[/url] and for some reason it doesn't work.. it says time is undeclared for some reason [CODE]#include <stdio.h> #include <conio.h> #include <stdlib.h> int main(void) { int i=0; srand(time(NULL)); while (i<200) { printf("%d\n", 1+rand()%6); i++; system("cls"); } system("PAUSE"); return 0; } [/CODE] | |
Hello :) (Too many questions about this)! Basically, I'm trying to display the contents of a matrix without using "cout" in my class. (It's a bad method) I've tried to return an array, but, that failed miserably.. So I've got a method in my class: [code] double Matrix::read(int theRow, int … | |
I have been programming in C++ for a while now. I heard about RSA Encryption algorithm, and i have read many online sites on how it works. But i still cant grasp how the algorithm works. i have tried to make programs with RSA, but they doesnt encrypt. If you … | |
I have this assignment where i have to create a program that executes another one, and it can terminate it, see how much ram it uses, and runtime. i have tried using system(); but it doesn't enable me to terminate the program after a set duration of time.. Any help … | |
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" … | |
Hello, This code is for (hospital management system). This code allow you to add patients. There are two types of patients. which is: 1. Normal patient. 2. Critically ill patient. once you added any patient. You will be able to show all patient using "ShowAllPatient;" method. -> i want the … | |
Hello, basically I want to return an array from a function (So I don't output things in the class - just main) But I seem to get the error: "invalid types 'int[int]' for array subscript" Here is the code: [code] #include <iostream> using namespace std; int matrix() { int matrix[10] … | |
I normally don't try to get outside help on homework that is still due, but I've kinda' hit a wall on this one. I'm trying to write a program that dynamically creates a list of scores for a group of students. It has to ask the user how many students … | |
what if i want to find out the age or period laps between certain dates for a database of 200 persons. for example: 1- aaaa dob: 12-12-1983 2- bbbb dob: 01-04-1980 i want to get out put as aaaa's age on 01-01-2012 is xx day, xx months xx years and … | |
Hello.. I'm doing a project that involves searching/matching 2 matrix's. The basic idea: Matrix 1: 0 1 0 1 0 1 0 1 0 1 1 1 1 0 1 Which will then be interpreted in memory as: 0 1 0 1 0 1 0 1 0 1 1 1 … | |
| I want to get the information downloaded from a file (a BMP image) into a char array. I have this function [CODE] #define _countof(x) (sizeof(x) / sizeof(x[0])) char* DownloadBytes(char* szUrl) { HINTERNET hOpen = NULL; HINTERNET hFile = NULL; char* data = (char*)""; DWORD dataSize = 0; DWORD dwBytesRead = … |
Hi, just a quick question. if i have an input file with 6 lines of data. for example(ingnore the numbers 1 to 6, they indicate the file number and is not part of the file physically) 1. Peter 3 / + - * 2. Dahne 8 + - / * … |
The End.