49,766 Topics

Member Avatar for
Member Avatar for Howdydoody

Hey guys I have the following class code and i get an error in the addVertex method that says vertexList is not declared in scope but i dont know why. [CODE] #include <iostream> #include "DirectGraph.h" #include <string> #include <list> #include <vector> DirectGraph::DirectGraph(): vertexList(100) { } void DirectGraph::printShortestPath(int source) { } …

Member Avatar for Howdydoody
0
305
Member Avatar for VernonDozier

Here's a simple, though not the most efficient, program that flags and displays all prime numbers less than or equal to 1000.

Member Avatar for 014
0
781
Member Avatar for eskimo456

Hi I am currently primarily programing graphics applications and am still fairly new to this. I know the relevance and can see the advantages of making items a template especially with things such as collision detection. I was wandering is there any advantage/disadvantage to doing everything as a template? Obviously …

Member Avatar for eskimo456
1
123
Member Avatar for caut_baia

Hi everyone.I have a strange problem.I've written a class which handles registry keys and values of which there are two functions [code] template<> unsigned long RegistryEntry::GetValue <unsigned long> (std::string Name) { unsigned long Value; unsigned long DataSize; assert (RegQueryValueEx (Key,Name.c_str(),0,NULL,(unsigned char*)&Value, &DataSize)==ERROR_SUCCESS); return Value; } template <> char* RegistryEntry::GetValue <char*> …

Member Avatar for Ancient Dragon
0
272
Member Avatar for fglom

I'm trying to save everything to a .txt file with a new line after every string, but I can't get it to work for me. I tried using [ICODE]<<endl;[/ICODE] and [ICODE]"\n"[/ICODE] but it all gets written in a single line. So if I enter "John" for [ICODE]first[/ICODE], "Smith" for [ICODE]last[/ICODE], …

Member Avatar for fglom
0
178
Member Avatar for daviddoria

Hi all, I am trying to write a function to solve an equation for one of its variables. E.g. X + Y + Z = 0 This equation would be represented by its parameters: parameters[0] is X, parameters[1] is Y, parameters[2] is Z. If the user wants to solve for …

Member Avatar for mrnutty
0
740
Member Avatar for taumang

help me with this kind of program,i have tried to declare those variables but it continues to say u ndeclared identify CBDA [CODE]#include<iostream> using namespace std; int main() { float catergory A; float catergory B; float catergory C; float catergory D; const float Catergory of pair A = -999,99; const …

Member Avatar for taumang
0
93
Member Avatar for GhostMonkey

Hi, I've got an array where you enter values into it but I want the values you enter to be a separate colour from the values initially in the array. I tried simply using set colour when you enter the value but I've coded it so that after every user …

Member Avatar for GhostMonkey
0
105
Member Avatar for jnewing

Ok so I'm looking for a quick efficient way of reading the following binary data into memory. I'm currently reading it all and then have my own functions that break it up via the separators 0x7d (|) and read each on into a variable, however I was thinking about reading …

Member Avatar for jshoot
0
113
Member Avatar for kumarmpk4u

Hi, i am converting a vc++ project written in 16 bit code to 32 bit code. Am using VC++ 6.0. In the 16 bit code they have used a in build class [COLOR="Red"]cvbcontrol[/COLOR] which is not supported in 32 bit environment. CVBControl class was used in the code to display …

Member Avatar for Ancient Dragon
0
171
Member Avatar for SWEngineer

I have the following `main.cpp` file: [CODE] #include <QApplication> #include "ui_checkabder.h" #include <QDialog> int main(int argc, char *argv[]) { QApplication app(argc, argv); Ui::CheckAbder ui; QDialog *dialog = new QDialog; ui.setupUi(dialog); dialog->show(); return app.exec(); }[/CODE] And, get the following errors when trying to run the program: [CODE] C:/Users/avbder/Desktop/abder/main.cpp:7: error: 'CheckAbder' is …

Member Avatar for JasonHippy
0
155
Member Avatar for SWEngineer

When I try running a Qt application with the following main.cpp file: [code] #include <QApplication> #include "ui_checkabder.h" #include <QDialog> int main(int argc, char *argv[]) { QApplication app(argc, argv); Ui::CheckAbder ui; QDialog *dialog = new QDialog; ui.setupUi(dialog); dialog-&gt;show(); return app.exec(); } [/code] I get the following errors: c:/QtSDK/Desktop/Qt/4.7.3/mingw/lib/libqtmaind.a(qtmain_win.o):-1: In function `WinMain@16': …

Member Avatar for SWEngineer
0
493
Member Avatar for thilinam

Hello All, Have somebody heard about a C++ library which help Agent programming like Java Agent Development Environment(JADE). Please let me know. I googled it but I could not find. Thank you ThiLiNa

Member Avatar for thilinam
0
1K
Member Avatar for mariusiacob

Any help would be appreciated with this program : I have a file with 5 lines....each line has name, id , phone ...etc... I have to read that intro an array of structures and display the results. This is what I have so far .. I doesn't not display anything …

Member Avatar for abhimanipal
0
3K
Member Avatar for lesfleurs

I am experiencing a strange error with the constructor for a binary search tree. The project is for an Hoffman Encoding scheme however the issue is whenever i insert more than two items into the STL priority queue, the copy constructor crashes. [CODE] void copyTree(myTreeNode* & copy,myTreeNode* originalTree) { cout<<"Copy …

Member Avatar for mike_2000_17
0
201
Member Avatar for Craftknight

Hello, I have been trying to get this program to work for a while now with no luck and I was hoping that someone could clear things up. My problem is the program always gives the failure to open file message so I can't tell if anything else works or …

Member Avatar for Craftknight
0
140
Member Avatar for cretaros

Hey guys im using Ms Visual C++ Compiler, im encountering this error bt i cant manage to solve it, pliz help. Attached pliz find the source code Error : 1>c:\users\h\desktop\wautil\wautil\wautil.cpp(23) : error C2144: syntax error : 'int' should be preceded by ':' 1>c:\users\h\desktop\wautil\wautil\wautil.cpp(33) : error C2144: syntax error : 'double' …

Member Avatar for sergent
0
87
Member Avatar for cafegeo

Hello everyone. I am trying to find the max values of each column in this 5 column array. I have skipped the first column because it is just the product name. The other 4 columns contain revenue of that product. The function I wrote below works for col 1, 2 …

Member Avatar for cafegeo
0
1K
Member Avatar for sha11e

I want to make a project, have 3 files: main.cpp header.h declerations.cpp where i have all the function declarations. But I'm not sure how to link them all together. When I make a header file, it automatically types the #ifndef header_h but I thoguht that should be in the declerations.cpp?? …

Member Avatar for mike_2000_17
0
277
Member Avatar for frenzra

5 code movietitle 1 Kungfu Panda 2 Hop 3 Hikayat Merong Mahawangsa 4 The Roomate 5 Pirates Of The Carribean 4-On Stranger Tides how to read this kind of data??

Member Avatar for mike_2000_17
0
98
Member Avatar for clickspiker23

[CODE] // this is main.cpp // stuck on getting the ouput of the distance NOT to be 0 i think its someting to do with the variables // in the distance method in the point.cpp file // The invokeX and invokeY are set to 0,0 cout << "The distance from …

Member Avatar for ravenous
0
139
Member Avatar for programing

hi i make code for double linkedlist.. but i didn't have a syntax erroe .. i don't know where the error . [ICODE]#include <iostream.h> struct dnode { int info; dnode *next; dnode *prev; }; class dlist { private : dnode *head; dnode *tail; dnode *current; public : void addEnd(int y){ …

Member Avatar for Lerner
0
137
Member Avatar for Khoanyneosr

So I'm learning OpenGL on my own and I have to say I'm really liking it. I really have not been able to do much, you'd laugh if i told you how much i knew but are there any real techniques for drawing shapes? I'm having trouble trying to figure …

Member Avatar for n.cramp
0
173
Member Avatar for The physicist

Hi all, I'm sure it's an error by me, but I'm having a problem with ifstream inside a loop. The reason for the loop is read in a piece of text from multiple files, and cases within the switch statement change the filename, path is previously declared. The first iteration …

Member Avatar for The physicist
0
2K
Member Avatar for asadaziz

I am working on visual studio 2008 what i want to do is read till the end of the file the code i am using is [CODE] StreamReader ^sr= gcnew StreamReader("example.txt"); String ^str; while(sr->Read()!= 0) { str=sr->ReadLine(); textBox2->Text=sr->ReadLine(); MessageBox::Show(str); } sr->Close(); [/CODE] what could be used inside while condition that …

Member Avatar for MattyRobot
0
1K
Member Avatar for BurgerBob

Hi guys, i'm doing a 7 week C++ course at the min and am struggling to keep up. Any help on the following is appreciated. Background Info: The game of craps: A player rolls two dice. Each die has six faces. These faces contain 1, 2, 3, 4, 5 and …

Member Avatar for BurgerBob
0
673
Member Avatar for yapkm01

m reading c++ primer 4th edition by Stanley Lipmann and I'm on page 92 about value initialisation. I just don't understand when about value initialisation. I browsed around and I know there are also default initialisation and zero-initialisation. Can anyone explain about value initialisation? Coming to this paragraph .. clause …

Member Avatar for yapkm01
-1
320
Member Avatar for clickspiker23

I am trying to get the midpoint between two points. one of the points by default is (0,0). The other point is entered by the user. the problem i am having is getting it to work correctly from the point class in point.cpp. it worked correctly when i put it …

Member Avatar for LevyDee
0
407
Member Avatar for jnewing

Here is Libaray 1 that I would like in the namespace "MyLib" [code] /** * lib1.h */ #ifndef LIB1_H #define LIB1_H #include <iostream> #include <fstream> #include <vector> namespace MyLib { class Lib1; } class Lib1 { public: Lib1(); ~Lib1(); int some_lib1_function(int foo); private: MyLib::Lib1 *lib1; }; #endif /** * lib1.cpp …

Member Avatar for mike_2000_17
0
94
Member Avatar for skips

I've only written one simple class before, yesterday. I am required in this assignment to use all of these functions, even though I don't think they are all necessary. I believe that my problem is just a matter of not knowing exactly how to pass one variable, which is created …

Member Avatar for skips
0
217

The End.