49,756 Topics
![]() | |
Hi, I am trying to understand functions in my C++ class and i was wondering what would be an algorithm to evaluate function and find its maximum and minimum. If someone could explain this to me i would greatly appreciate. | |
Problem: Write a program that uses a loop to display the characters for each ASCII code 32 through 127. Display 16 characters on each line with one space between characters. I have tried solving this problem several ways. I either get blank screen or numbers 1-16. Can anyone lend a … | |
Just when I think I understand this stuff some else crops up to bite me. This part was supposed to be the easy part of the overall project so this does not bode well... What am trying to do is create an array of 32 variables that will be filled … | |
I realize this is a pretty simple operation, however im totally lost, and no post I could find seem to touch on the exact same subject as mine. I have a text file, where each line is formatted like so: [CODE]float1,float2,float3,float4,float5,float6[/CODE] Each float is separated by a comma. The number … | |
This is my first time to use the string function. And I met some errors while doing the practice. We now need to input some words, until we input a word with 4 letters. Then the program will show the smallest and the biggest word among our inputs. e.g. Enter … | |
I am using the free alternative to SPY ++ known as Winspector, and was suggested to start using this to get more familiar with windows and handles and process handles etc... My question here is I notice when I put the crosshair over certain windows I get WINDOWS and a … | |
Is there a way to create a C++ program to rewrite a query in an optimal form without the use of a database such as storing information in arrays. If so, how? What can I do to implement this. Rewrite SELECT EMPOYEE.EMPNO, POSITION FROM EMPLOYEE E, JOBHISTORY J WHERE E.EMPNO … | |
I am building a dll file. when i try to compile the dll file i get the following errors... help me am new to vc++... tool used is visual studio 6.0 GPPSCOM.OBJ : error LNK2001: unresolved external symbol "double __cdecl RoundDown(double,int)" (?RoundDown@@YANNH@Z) GPPSCOM.OBJ : error LNK2001: unresolved external symbol "double … | |
How can I check that the user actually is inputting what I want them to? (For example letters or numbers); I need the user to input y or n, so here is how i tried to solve it: [CODE] char answer; do { system("cls"); cout <<"Want to play? <y/n>: "; … | |
[code] class complex { int real; int imag; public: complex(){}//why default constructor is always needed complex(int a,int b){real = a;imag = b;}// why can't we define only this constructor ~complex(){} }; [/code] | |
This is the full code and the single error!!!!! 1>d:\s\o.o\hws\new folder\shop\shop\main.cpp(37): fatal error C1075: end of file found before the left brace '{' at 'd:\s\o.o\hws\new folder\shop\shop\shop.h(8)' was matched [code] #include<iostream> #include<string> using namespace std; #ifndef SHOP_H #define SHOP_H class Shop{ friend ostream &operator<<(ostream &output,const Shop &S){ output<<"\nThe name of the … | |
i make twwo single linkedlist,, but i didn't know how i can merge those lists ;; [ICODE]#include <iostream.h> class linklist { private: struct node { int data; node *link; } *p; public: linklist(); void append( int num ); void appendd(int size); void display(); }; linklist::linklist() { p=NULL; } void linklist::append(int … | |
I have an assignment where I need to Sort the linked list according to Int Variable after the user has input the information. When I try using bubble sort I'm stuck because I don't know how go back to the beginning. If a user enters : 5 4 3 2 … | |
I'm trying to make the quicksort but it's not working at all. I made a helper function "swap" so I can call it back in the "quick"function. then used recursive method to do it till the array is sorted. The problem is.. IT'S CRASHING EVERYTIME I RUN IT... i think … | |
Hey guys, so I just started learning computational geometry, and I decided to make a class for a Point and a class for a Ray. This is my code: [CODE]#include <iostream> #include <string> using namespace std; class Point { public: double x, y; Point(double x, double y) { this->x = … | |
I am making a program which includes comaring 2 numbers (int's) but later I want to call another windows function and it takes in CHAR not int. I need a way to convert my ints to char. I looked up this on internet and non if it worked. Do you … | |
Any tutorials on how to use CFile or any other, to open a text file, get what's inside into memory, e.x Link List, and then put it back into text file when done? Please link me or guide me through this problem. Trying to get a Payroll system going. | |
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) { } … | |
Here's a simple, though not the most efficient, program that flags and displays all prime numbers less than or equal to 1000. | |
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 … | |
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*> … | |
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], … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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->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': … |
The End.