49,761 Topics

Member Avatar for
Member Avatar for ProgrammingGeek

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]

Member Avatar for ProgrammingGeek
0
135
Member Avatar for radiat

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 …

Member Avatar for Bench
0
190
Member Avatar for swissknife007

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

Member Avatar for StuXYZ
0
106
Member Avatar for compsci91

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. …

Member Avatar for compsci91
0
199
Member Avatar for phorce

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 …

Member Avatar for histrungalot
0
163
Member Avatar for wildplace

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 …

Member Avatar for mrnutty
0
5K
Member Avatar for Labdabeta

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]

Member Avatar for rubberman
0
150
Member Avatar for SumPersonGuy

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 …

Member Avatar for tungnk1993
0
156
Member Avatar for aparichit4evr

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. …

Member Avatar for tungnk1993
0
279
Member Avatar for senergy

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: …

Member Avatar for senergy
0
106
Member Avatar for suneye

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 …

Member Avatar for Ancient Dragon
0
150
Member Avatar for Ahmed2

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 …

Member Avatar for deceptikon
0
615
Member Avatar for Karlwakim

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 …

Member Avatar for jbennet
0
88
Member Avatar for ICTGUY

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 …

Member Avatar for ICTGUY
0
319
Member Avatar for squinx22

hi! What is makefile? How does it work? Is it done in the terminal? I am using Unix OS

Member Avatar for palashjhabak
0
156
Member Avatar for picogenkaku

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 …

Member Avatar for picogenkaku
0
236
Member Avatar for The_Purple_Mask

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?

Member Avatar for mike_2000_17
0
259
Member Avatar for mrmodest34

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 …

Member Avatar for mrmodest34
0
232
Member Avatar for jeyjey223

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]

Member Avatar for deceptikon
0
103
Member Avatar for phorce

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 …

Member Avatar for ravenous
0
116
Member Avatar for MasterHacker110

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 …

Member Avatar for Moschops
0
328
Member Avatar for mikeshadow

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 …

Member Avatar for gerard4143
0
68
Member Avatar for radiat

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" …

Member Avatar for Ab000dy_85
0
181
Member Avatar for general07z

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 …

Member Avatar for WaltP
0
2K
Member Avatar for phorce

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] …

Member Avatar for phorce
0
198
Member Avatar for sinatra87

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 …

Member Avatar for sinatra87
0
245
Member Avatar for Dhananjay_1976

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 …

Member Avatar for Ancient Dragon
0
74
Member Avatar for phorce

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 …

Member Avatar for mrnutty
0
105
Member Avatar for alexbnc

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 = …

Member Avatar for alexbnc
0
332
Member Avatar for skannigan

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 + - / * …

Member Avatar for Ancient Dragon
0
207

The End.