49,761 Topics

Member Avatar for
Member Avatar for helloworld1234

my professor has asked us to solve the following problem but im having trouble understanding it **Write a function that takes in a 2 dimensional array of integers and returns the third largest number. Let the number of columns of your 2 dimensional array be 5. Call this function from …

Member Avatar for zeroliken
0
232
Member Avatar for cdsr

Alright so I've been struggling to find the error but I simply can't. Given the following code: #include <iostream> #include <vector> enum ScriptType { SCRIPT_TYPE_CREATURE_SCRIPT, SCRIPT_TYPE_PLAYER_SCRIPT }; class Script { private: ScriptType type; public: Script(ScriptType type) : type(type) { } ScriptType getScriptType() const { return type; } }; class CreatureScript …

Member Avatar for cdsr
0
294
Member Avatar for BARI DANIYAL
Member Avatar for on93

anyone know how to use bubble sort and also binary search ? this program cannot search out the name that user insert. anyone know how to fix it ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include<iostream> #include<string> #define size 5 using namespace std; struct student { string name; int id; string prog; double cgpa; }; …

Member Avatar for rubberman
0
172
Member Avatar for Shft

Hello daniweb, I've been trying to impliment arrow keys into my program, I've found a way, but the problem is I cant figure out how to use the enter key to select an option as follows: pawns: int pawn; system("cls"); pawndd: gotoxy(0,0); SetConsoleTextAttribute(hColor,455); cout<<" RETURN TO PREVIOUS MENU"; SetConsoleTextAttribute(hColor,23); cout<<"\n"; …

Member Avatar for deceptikon
0
336
Member Avatar for eclipsethemoon

1. Search Benchmarks Create a New Project called YourLastnameSearch. int array[20] = {78, 45, 33, 1, 6, 41, 99, 54, 73, 28, 101, 60, 21, 82, 11, 15, 654, 36, 52, 70}; Write a program that has an array of 20 integers. (You must use the above array.) It should …

Member Avatar for tinstaafl
0
141
Member Avatar for capton

After appending an item to a QList which is pointed to by a QMutableListIterator, I find out the next value of the iterator points outside the list. Or can't i point the iterator to any where in the list except the beginning and end? Please i need help.

Member Avatar for capton
0
135
Member Avatar for helloworld1234

Hello everyone, I have written a code for binary search for my class. My professor asked us to create it using bool, and the header function "bool binarySearch(int a[], int start, int end, int number)". I am having some issues with it. it all seems fine until i get to …

Member Avatar for helloworld1234
0
163
Member Avatar for can-mohan

Hi All, While executing below code without using assigment operator it works fine , eventhough i have been used pointer values, so any way it must crash as The memory that s2 used to point to was never deleted; it is lost forever as both a and b now point …

Member Avatar for ravenous
0
269
Member Avatar for on93

i insert the different id , but the program out with pointer value anyone know why ??? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include<iostream> #include<string> #define MAX 6 #define size 10 using namespace std; struct student { string name; int id; string prog; double cgpa; }; class stinfo { private: student data[size]; int last; public: …

Member Avatar for deceptikon
0
148
Member Avatar for nabeelkhanjadoon10

I am first semester student and studiyg CS. I need a c++ project atleast 1000 lines of code. but the project is too simple. I have studied yet Arrays..

Member Avatar for DoRight
0
6K
Member Avatar for can-mohan

Hi, As per below code snippet it is clear that in below class a if we don't introduce assignment operator despite of having pointer values it works fine as memory allocation is done explicitly by declaring s2 object on heap . can anybody suggest, if same canbe achieved without declaring …

Member Avatar for Lucaci Andrew
0
267
Member Avatar for on93

Problem of sorting the ID in int main. anyone know how to fix the code ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include<iostream> #include<string> #define MAX 6 #define size 10 using namespace std; struct student { string name; int id; string prog; double cgpa; }; class stinfo { private: student data[size]; int last; public: stinfo(); …

Member Avatar for on93
0
156
Member Avatar for izabella.pearson

Okay so I have all of the coding and logic down except for ONE little part. I can not figure out how to actually implement my functions into the main because I keep getting errors that have to do with pointers. Please help! The point of the program is to …

0
96
Member Avatar for BARI DANIYAL
Member Avatar for NathanOliver
-1
164
Member Avatar for on93

anyone know what is this error , how to fix it ??? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include<iostream> #include<string> #define MAX 6 #define size 10 using namespace std; struct student { string name; int id; string prog; double cgpa; }; class stinfo { private: student data[size]; int last; public: stinfo(); void selectionSort(int A[]); void …

Member Avatar for Banfa
-1
560
Member Avatar for alanso

hey guys this c++ code which needed to convert to asm and when user enter 2000 the clock shoud show lest then 5 sec.... for (a=0; a<=y; a++) for (b=0; b<=y/2; b++) for (c=0; c<=y/3; c++) if ((a + 2*b + 3*c) == y) count++; this is the question -finds …

0
119
Member Avatar for Chuck2013

Hi, I have inherited a pair of applications: a client.exe and a server.exe. They run on different PCs and communicate through TCP/IP. The server comes with an OCX file: server.ocx. The client has its own OCX file: client.ocx. (I suspect there could be a mismatch between the two ocx files.) …

Member Avatar for Ancient Dragon
0
296
Member Avatar for daino

Does anyone know how to call a binary executable file from another program. I have a simple binary file which can take command line arguments called **InputProgram.exe**. I have made another program of which I want to call InputProgram from and pass it an argument. Not this is going to …

Member Avatar for daino
0
728
Member Avatar for alanso

Guys..My task is to convert for loop c++ to asm....and the speed shoud be fast....i managed to convert to asm the loop part but when i run and enter 2000 it shows 33 second is it possible to be lower the 5 second.... #include <iostream> #include <ctime> using namespace std; …

Member Avatar for Banfa
0
418
Member Avatar for spawn2004

Hi everybody I need some professional help from experienced people. I am writing a program in C++ about a game. I have to specify a class Questions with attributes question, answers and difficulty. In the program i should have methods add, edit, select, search, print and remove. The problem that …

Member Avatar for Lucaci Andrew
0
191
Member Avatar for falcan
Member Avatar for Banfa
0
51
Member Avatar for chound

How do we create datatypes in C++. Eg. creating datatype called "myowndatatype" with sizeof(myowndatatype) = 3

Member Avatar for ravenous
1
269
Member Avatar for Tonyi1

`Hello and thanks for reading my post. I am trying to develop a program that will select a file for opening based on user input. I did have this code working at one point but no longer. I am a beginner at C++ so I am trying to learn from …

Member Avatar for Tonyi1
0
350
Member Avatar for Kareem Klas

Hello I'm using the book C++ Primer 5th edition and in the beginning there is an exercise to change a sum into a prodcut. #include <iostream> int main() { std::cout << "The sum of " << v1 << " and " <<v2 << " is " << v1 + v2 …

Member Avatar for deceptikon
0
151
Member Avatar for deceptikon

As the title says, it's a simple trie class written in C++11. The only operations implemented are insert, remove, and search (both prefix and exact matches). I sort of abandoned the test/debug process, and while I'm somewhat confident that there aren't any serious bugs, I can't guarantee it. Use this …

Member Avatar for deceptikon
3
405
Member Avatar for MRehanQadri

If the prototype of my function is void sell_item(store **head,store **tail). In main i've passed sell_item(&head,&tail), where head & tail where both pointers of store(struct) type. Now I want to access the the content where head is pointing to. How shall I access it? Like *head->next??? But this is not …

Member Avatar for MRehanQadri
0
166
Member Avatar for nitin1

#include<iostream> #include<string> #include<vector> #include<algorithm> #include <cstdlib> using namespace std; int main() { char s[5]; string g; int p=345; sprintf(s,"%d",345); g=s; g+=".mp3"; cout<<g<<endl; getchar(); return 0; } I have a very small doubt about strings. this is code snippet i have shown. when i have called sprintf(), then it has changed …

Member Avatar for Moschops
0
161
Member Avatar for greatman05

This is a homework assignment. I am in a Software Engineering class and we have to implement a change request in a group project. My group chose Winmerge, and my change request is to do the following: 1.) Set the divider to reset to the middle on double-click. 2.) Allow …

Member Avatar for Ancient Dragon
0
195
Member Avatar for nova37

am using dev c++ updated version for my project am using myql c api problem is when i run my application it stop and says that mysql.dll is missing , currently when i place mysql.dll in the app folder it cant give me the error , so i want to …

Member Avatar for Ancient Dragon
0
188

The End.