49,756 Topics

Member Avatar for
Member Avatar for hanttaha

[CODE]//I have a problem with my program, // the function rank to find rank of a matrix //cannot return the result //somebody help me to correct it! #include<iostream.h> #include<math.h> #include<iomanip.h> class matrix { int n,m; double A[6][6]; public: //..... friend int rank(matrix); }; int rank(matrix B) { int i, j, …

Member Avatar for ravenous
0
3K
Member Avatar for kevintse

[CODE]#include <iostream> using namespace std; const char* foo() { return "Hello"; } const char* bar() { const char* s = "world"; return s; } void print(const char* s) { cout << s << endl; } int main () { cout << foo() << endl; print(bar()); return 0; }[/CODE] Can I …

Member Avatar for kevintse
0
126
Member Avatar for skorm909

i was wondering how i can make it so i do something like: [CODE]cout << "Press any key to continue." << endl;[/CODE] what kind of code do i need to put it so that the program dosnt do anything until someone presses any key on the keyboard?

Member Avatar for vsvivek796
0
225
Member Avatar for salty11

I need some help with this program, im obviously not so good with this stuff, but since this is the only one i haev left to make i thought i would ask some of you guys for help the problem is: Write separate programs to do the following: 1) Convert …

Member Avatar for mrnutty
0
249
Member Avatar for Tiancailee

Hi i am mostly done with my assignment where u have to make a simple object viewer. one of the requirements require you to use multiple instantiation of objects from the same class which i do not know what to do about it. This is my code for main.cpp [code] …

Member Avatar for Tiancailee
0
174
Member Avatar for JeremyJ

Hi, I need to download URL's to a file using C++ code. Does anyone know of a library, compatible with Windows, that will do this? I know about CURL, but after spending days trying to configure LibCurl using Cygwin I'm ready to give up. A friend has been able to …

Member Avatar for JeremyJ
0
926
Member Avatar for rocktea

i want express graph as adjacency matrix but 2 element of graph have more 1 street should element of adjacency matrix have more 1 value .i don't know express ? who know guidance for me?

Member Avatar for alwaysLearning0
0
101
Member Avatar for halopower67

Hey guys, im currently doing my frigate project for my semester class intro to c++ and im stuck at a part where my program crashes after the ships move for a while, any clues? Also, im stuck in the overall development of the game, im not sure how to get …

Member Avatar for daviddoria
0
79
Member Avatar for Eagles36

I am trying to read a txt file into a binary tree. I have the computer create the binary tree from the txt file. Once it adds to the binary it learns what you add. I got it to do the second portion I cant get it read it in …

Member Avatar for daviddoria
0
100
Member Avatar for yardi

Can anyone be kind enough to teach me how to create programs that are sport related. Such as a program for a football/soccer league that does the following: Store players names, numbers, team, goals scored, etc. Show goal difference, league standings of teams. Be able to log information such as …

Member Avatar for ravenous
0
121
Member Avatar for skorm909

i was working on a simple calculator and here's the problem I'm having: i want the whole program to loop over and over until the user decides to stop, so i put a while in there and the loop works great, but when the user is done inputting the numbers …

Member Avatar for Jason Giggs
0
164
Member Avatar for flasp

I cant solve this assignent. I hope a helpfull soul can help me out. The problems goes like this: Write a program that ask the user to enter the number of seconds as an integer value(use type long) and that then displays the equivalent time in days, hours, minutes and …

Member Avatar for Jason Giggs
0
169
Member Avatar for bflack

//I need help please? [CODE]#include<stdio.h> #include<iostream.h> class Time { public: Time(); ~Time(); void setTime(int, int, int); void printMilitary(); void printStandard(); private: int hour, minute, second; }; void Time::printMilitary() { cout<<"Military time: "<<hour<<minute<<second; } Time::Time() { hour=minute=second=0; } Time::~Time() { cout<<endl<<"Destructor code."; } void main() { Time wakeup, samplePM; wakeup.setTime(6, 5, …

Member Avatar for WaltP
0
449
Member Avatar for penguins10

Hi, I have a homework assignment that I just cannot figure out. I would be grateful of any help. The assignment is: Create a program which: Implements a class called Queue: The class should contain an array of maxQ integers. There should be two constructors: One that takes no argument …

Member Avatar for Zeeshan Cheema
0
239
Member Avatar for Leppie

My program runs a three dimensional maze (3x3x3 = 27 locations) it has a start room exit room and code room all in a loop so no two are the same location, the start and exit rooms show up on the run compiled program but the code room does not …

Member Avatar for Leppie
0
129
Member Avatar for SabinIvy

Okay I have tried everything to alter the code but nothing works, so I ask for your help. The thing is I am trying to turn my code from this: *______* **____** ***__*** ******** ***__*** **____** *______* into this: *________* **______** ***____*** ********** ***_**_*** **__**__** *___**___* ____** ____** ____** ____** …

Member Avatar for VernonDozier
0
437
Member Avatar for skorm909

I'm making a simple text RPG game that I will later (once i get the code running well in the text version) put it to graphics and so on. Basically what this code is doing is, there's a monster that the user just killed. based on that monsters level that's …

Member Avatar for sfuo
0
217
Member Avatar for MatthewT

Hi, I'm writing a program in C++ that is driven by events that occur externally to the computer. As far as the program is concerned the event is just a change from false to true and I figure the simplest transmission mechanism would be over a single pin on the …

Member Avatar for VernonDozier
0
98
Member Avatar for Spiffy P Mcgee
Member Avatar for CJMW
Member Avatar for kamotekid08
0
234
Member Avatar for chamika.deshan

Hi I have a third party code. [CODE]class Lazy { protected: template <class T> static void create( T*& ptr ) { ptr = new T; } }; template < class ClassT, class Policy=Lazy > class MakeT : private Policy { public: static ClassT* instance() { static ClassT* ptr = 0; …

Member Avatar for mrnutty
0
142
Member Avatar for kamotekid08

How can I create a program where the output is name,horoscope,birthdate and birthstone..

Member Avatar for kamotekid08
0
107
Member Avatar for i_luv_c++

Hey Guys, I am writing a Recursive Function which picks the best move for Computer(sort of A.I.) i have done all the base cases however couldn't figure out how to deal with the last part. [QUOTE]Given n stones the player can remove 1, 2 or 3 stones per move. The …

Member Avatar for mrnutty
0
122
Member Avatar for g_riding

I am learning C++ and having a problem with adding numbers in a [10][10] array. It reads the data from a file. I have the array set up and I have to add the numbers diagonally left and right. I have to add prj6[0][0] then prj6[1][1] then[2][2] and so forth. …

Member Avatar for g_riding
0
435
Member Avatar for Ragster

Hi, this is my first time posting here so I'm sorry if I post something wrong. I have an assignment for my class and I think I have done everything right, well except for this one error that's been killing me. I get this error for each function call when …

Member Avatar for Ragster
0
689
Member Avatar for louiscos77

Hi guys, I'm planning to make a car game & for that I'll use Microsoft Visual C++ 2010 for programming, directX 10 for the graphics, & Nvidia PhysX engine for the physics. The problem is that I can't find any tutorial of directX and Nvidia PhysX, I only find of …

Member Avatar for louiscos77
0
558
Member Avatar for ace8957

Hi all, So I'm currently teaching myself about hash tables. I'm doing a programming challenge where I create a hash table that stores instances of a class Person, with data members for name, phone number, and GPA. The table uses separate chaining to take care of collisions. The node I'm …

Member Avatar for ace8957
0
264
Member Avatar for theashman88

I have to create a program that requires the user to enter the zip code. The zip code must be 5 digits. I know how to do that using if statement and string.length(). What I don't know how to do is how to make sure the program only inputs and …

Member Avatar for dnambembe
0
107
Member Avatar for qvyhnl

Can someone show me how to write a recursive function that count how many time the number 7 occur in an integer. Thanks

Member Avatar for mrnutty
0
97
Member Avatar for jsav

A program I'm trying to compile is simply not working right. I have everything defined the way it should with all the right #include statements there. However, anytime I try to compile with g++, it tells me the functions are undefined. Really, I should not be getting this error. I …

Member Avatar for jsav
0
276

The End.