49,757 Topics

Member Avatar for
Member Avatar for glenwill101

hello ive been working with c++ for a few weeks now and from yesterday ive attempting to write a console game but i keep getting an error. //where all the noise is coming from class Story{ public: Story(); ~Story(); void mainMenu(); void start(); private: void levelOne(); void judgement(); }; Story::Story(){ …

Member Avatar for glenwill101
0
104
Member Avatar for serdar.ilarslan

Hey guys i am in trouble about BST Tree exercise.. i need to create an array that can take number of elements user want and the user has to enter integers but the program need to get this number in one line ... Here is code that i already wrote …

Member Avatar for serdar.ilarslan
0
321
Member Avatar for Youler

Hi everyone, First post here so feel free to school me if my etiquette needs it. I'm reading a very long string of data (genome stuff AT TT GT AA AG AA ... etc) and comparing it using hamming distance with a similar string. (Naively checking for similarity entry by …

Member Avatar for Lucaci Andrew
0
156
Member Avatar for d.noora

**how we can use recursion in implementing tower of HANIO?? and how does it work i need someone's help ??!!!**

Member Avatar for Lucaci Andrew
0
91
Member Avatar for panatda.tokhume

#include<iostream> #include<fstream> #include<sstream> #include<stdlib.h> #include<math.h> #include<iomanip> using namespace std; int main() { int NUM_Object,NUM_Medoid; cout<<"How many menus u have?"<<endl; cin>>NUM_Object; cout<<"How many Medoids(k) do you want?"<<endl; cin>>NUM_Medoid; ifstream myfile("Nutrient.txt", ios::in); int i,j,k,count; count = 0; float TEMP_num; double Object[NUM_Object][5]; double Medoid[NUM_Medoid][5],Medoid_New[NUM_Medoid][5],SUM_Distance[NUM_Medoid],SUM_Pij[NUM_Medoid], SUM_P[NUM_Medoid],SUM_Distance_New[NUM_Medoid],SUM_Pij_New[NUM_Medoid],SUM_P_New[NUM_Medoid]; long double Distance[NUM_Object][Object]; for(i=0;i<NUM_Object;i++) { for(j=0;j<NUM_Object;j++) { Distance[i][j] …

Member Avatar for panatda.tokhume
0
186
Member Avatar for marius2010

Need to find larger prime number then has been inputed.how to do that: I *cin* 5 the reult it self should be 7...?

Member Avatar for Lucaci Andrew
0
190
Member Avatar for letterG

I'm stuck at comparing the operators, it seems I can only compare the current operator to the topmost of the stack, how do I keep on comparing it til the stack is null or the precedence don't hold true anymore?...i've commented the part where I think my program fails...any help? …

Member Avatar for letterG
0
4K
Member Avatar for robotnik

Hi, im trying to make a C++ project for my class which reads the input from a text file and outputs the mean, median, and mode. but im running into an error i get when i run it. i get this error when i try to build it error C2040: …

Member Avatar for Lucaci Andrew
0
392
Member Avatar for bdl365

1. Create arr, an array of size six. Each element of arr is a random two-digit positive integer. (The program should make a random selection using the function rand.) Print the elements of arr. 2. Compute x as the average of the array. Print x. 3. Compute y as the …

Member Avatar for Lucaci Andrew
0
89
Member Avatar for andrew mendonca

Assignment 9, Due Dec 2 Design and implement a program that allows the user to keep track of students in a college course. The program will function as a simple database in which students can be inserted, removed and updated. Additionally, the user can display students in order by name …

Member Avatar for andrew mendonca
0
219
Member Avatar for Weliaz

Hey there people! I have a problem with an application which i'm working on! The problematic code: #ifndef CONFIG_H #define CONFIG_H bool LoadConfig(); XMLElement* Element(std::string name); #endif Where the "XMLElement* Element" is the problem. I am using the library TinyXML-2 for this. If anybody could help I would be very …

Member Avatar for Weliaz
0
332
Member Avatar for ralph1992

I have attached a quick class model of what I am trying to achieve (Also, sorry for the mass of code but I figured I'd post everything I have thus far in case anyone saw other improvements I could make). I can give a customer an 'Account' but I want …

Member Avatar for phorce
0
8K
Member Avatar for QuantNeeds

I am not sure why this is occuring. I declared these functions in the header file and it is defined them in the .cpp file but in the main function it does not recognize them. Did I forget something basic or do something illegal? The errors: : error C3861: 'createAndInitializeTextFile': …

Member Avatar for fiqa92
0
4K
Member Avatar for highonbikes

so the assignment I have is for a bank login program. and the function looks like so Client* Bank::login() based off a boolean value this bank command(which has a private: client* to an array of clients) I have to return a pointer to the correct client or NULL. so simplified …

Member Avatar for Moschops
0
131
Member Avatar for adityasingh95

can sum1 pls explain why there isn't any output??? #include <iostream.h> #include <conio.h> void main() { clrscr(); int a[50][50],r,c,ans=0; cout<<"Enter Size of Array:"; cin>>r; r=c; for (int i=0;i<r;i++) { for (int j=0;j<c;j++) { cin>>a[i][j]; } } getch(); clrscr(); for (i=0;i<r;i++) { for (int j=0;j<r;j++) { cout<<a[i][j]; } cout<<endl; } cout<<endl<<endl; …

Member Avatar for L7Sqr
0
237
Member Avatar for acerious

BEGIN SEQ (n) IF (n <= 3) THEN RETURN n * 2 ELSE RETURN SEQ (n - 3) + SEQ (n - 1) ENDIF END For instance, for n = 8, I ran it in a compiler and the final return value is 38. I tried tracing it in the …

Member Avatar for vijayan121
0
139
Member Avatar for dot_binary

Hello! I'm trying to get the contents of a binary file into a char array, my read function is in main.cpp, in the header file is referenced as char fileio(char * bufferZ) , and is called in another .cpp file. The problem is , the code in the function cant …

Member Avatar for dot_binary
0
258
Member Avatar for savinki

Hi, wt is the function that can use to count number of digits in a long integer? e.g. 12345678 -> 8 11 ->2 456 -> 3 6724 -> 4

Member Avatar for Shahzad Ahmad
0
312
Member Avatar for honey_sw816

Many banks and savings and loan institution compute interest on a daily basis. On a balance by $1000 with an interest rate of 6%, the interest earned in one day is 0.06 multiplied by 1000 and then divided by 365, because it is only for one day of a 365 …

Member Avatar for nullptr
0
82
Member Avatar for 78jimm

I am making a game for a school project with gotoxy and getch and 2d character arrays. there is supposed to be a robot type figure that can move left and right by pressing 'a' and 'd'. so far i've been able to make the cursor go left or right …

Member Avatar for ken_taiken
0
298
Member Avatar for Youler

Consider the following. I have a text file with 5 rows of 5 characters each. I want to read in a line and then compare it to all the other lines. I create 2 ifstream objects pointing to the same file, first and second. first reads in the first line. …

Member Avatar for Youler
0
129
Member Avatar for softwaretime

Could someone please help me find out what the problem is with this simple program? This souldn't be happening. Here is the code: #include "stdafx.h" using namespace std; int main () { int numbers[5]; int * p; p = numbers; *p = 10; p++; *p = 20; p = &numbers[2]; …

Member Avatar for softwaretime
0
263
Member Avatar for DestinyChanger

Hi, I'm working on a robotic project in university and searching for a good robot programming language. If C++ can help PLEASE give me some advise that how can i start robot programming in C++.

Member Avatar for saly305
0
2K
Member Avatar for winter7621

**Please help me out** I am trying to do the following: "Create a program that calculates prime numbers from a certain number X to a number Y. Modify the program so as to run two threads at the same time. The first thread will start counting from X to Y …

Member Avatar for ktsangop
0
2K
Member Avatar for dsprep
Member Avatar for meaad.alhaddad

(A) Write a C++ program to sum all odd integers divisible by 3 in the range (X,Y). Integers X and Y are to be input by the user. Your program should validate that X is smaller than Y, and output error message if not. Note: Use whileloop for the validation …

Member Avatar for Schol-R-LEA
-1
100
Member Avatar for brand.lock

First off thanks for looking at this I have looked all over (both here and on the net) and tried several things trying to get this to work. I am using Visual Studio 2012 with DirectX (June 2010) SDK. I am attempting to write a fuctuin for sprite colission detection. …

0
76
Member Avatar for ktsangop

Hello everyone! I have a rather mysterious problem. I have a mfc dialog based application (running on win xp sp3), and at the same time another mfc app that installs a global keyboard hook capturing the ESC key (this one is always hidden). SOMETIMES when i press ESC key (with …

0
144
Member Avatar for nathaniscool99

Hello, I have been given a class diagram where a variable called light_years must be a const int and stored in the space class, but later on that value must be used in the main file. Below is the space class class space { private: static const int LIGHT_YEARS; public: …

Member Avatar for deceptikon
0
265
Member Avatar for daino

I'm trying to compile a project using Code::Blocks with a MinGW compiler (Windows XP). I have included the correct library file from boost and set the right include path but it doesn't seem to make any difference. Here's the error. The impression I'm getting is PdfContentsGraph class is not initializing …

Member Avatar for daino
0
391

The End.