49,756 Topics
![]() | |
[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, … | |
[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 … | |
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? | |
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 … | |
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] … | |
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 … | |
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? | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
//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, … | |
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 … | |
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 … | |
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: *________* **______** ***____*** ********** ***_**_*** **__**__** *___**___* ____** ____** ____** ____** … | |
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 … | |
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 … | |
I'm having no luck trying. Is it possible in C++? | |
Talk about C++ & Allegro here, any problems and ideas are welcome! | |
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; … | |
How can I create a program where the output is name,horoscope,birthdate and birthstone.. | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
Can someone show me how to write a recursive function that count how many time the number 7 occur in an integer. Thanks | |
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 … |
The End.