49,761 Topics

Member Avatar for
Member Avatar for daviddoria

I want to have a template function like this: [code] template <class T> void CreateBlankPatch(typename T::Pointer patch, unsigned int sideLength) { CreateConstantPatch(patch, typename T::PixelType::Zero(), sideLength); } [/code] It works fine as long as Zero() is defined for the class T. However, with POD types, this is clearly not the case. …

Member Avatar for daviddoria
0
166
Member Avatar for ace8957

Hey everybody, So I though that I understood linked lists and arrays well enough to make a hash table with separate chaining. Theoretically, it seems trivial, but I am getting a runtime error. The error appears to arise from the line head = heads[i], where head is a node pointer …

Member Avatar for Agni
0
178
Member Avatar for Wolf CCMLG

Hi, I am loading in a dictionary text file of English words, but I am not supposed to load any words if they contain an apostrophe. I am loading them in as strings, and I cannot figure out how not to load the string if it contains an apostrophe. Here …

Member Avatar for Wolf CCMLG
0
224
Member Avatar for bufospro

Hi all, I want to read a file. The file is like that : 20 20 1 5 6 20 21 1 2 3 21 22 2 4 6 20 20 2 3 5 20 21 6 5 2 21 22 1 6 7 .... and I would like every …

Member Avatar for bufospro
0
122
Member Avatar for SoftwareGuy

Hi. This should be very easy for you guys, but I still can't get it visualized in my mind. Here's what I'm trying to do: [CODE] if (flag) for (i = 0; i < 10; i++) {LARGE_BLOCK_OF_CODE (that visits an array in order)} else for (i = 9; i >= …

Member Avatar for SoftwareGuy
0
196
Member Avatar for abuka

I've got this header and cpp.And I would like to insert this operator overloading to this .h and .cpp file. but I always got errors. Operator OVERLOADING : [CODE]istream& operator>>(istream& in, Focista& jatekos) { cout << "Add meg a focista tulajdonsagait. " << endl; cout << "Nev: " << endl; …

Member Avatar for abuka
0
234
Member Avatar for Plastix!!

can anyone upload a simple modular example in c (They would include .c files and .h files please) i am currently working on modularization but i have a problem when it comes to the main.c and main.h. . . its an assignment. i just want to reference and work on …

Member Avatar for ravenous
0
66
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
927
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
123
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
165
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
177
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
457
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
241
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
142
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
443
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
221
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
235
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
143
Member Avatar for kamotekid08

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

Member Avatar for kamotekid08
0
109
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

The End.