48,985 Topics
| |
i'm trying to read a file into an array struct using a function, i get the errors: 1.error LNK2019: unresolved external symbol "void __cdecl loadarray(struct ElementType * const,int)" (?loadarray@@YAXQAUElementType@@H@Z) referenced in function _main 2.fatal error LNK1120: 1 unresolved externals [code] #include <iostream> #include <string> #include <fstream> using namespace std; ifstream … | |
[COLOR=#008000]//I need to change this program from using inheritance to using composition.[/COLOR] [COLOR=#008000]//Could someone please show me how? I have two other programs that I can surely do myself. [/COLOR] [COLOR=#008000]//I'm really in search of a sample.[/COLOR] [COLOR=#008000]// Fig. 9.17: point3.h[/COLOR] [COLOR=#008000]// Point3 class definition represents an x-y coordinate pair.[/COLOR] … | |
Hi, my goal is to implement a program (in OO style) for cruise booking system that can accept and maintain customers’ reservation. Whenever a customer visits, that program should show him/her the current availablility of cabins. A customer can choose any available cabin with specified level (0 – 2, down … | |
I hope, this is not a compiler issue. See the below code [CODE]#include <iostream> #include <string> using namespace std; string data,name; void getTst() { cout<<"Enter Name :"; getline(cin,name); cout<<"\nENter data :"; getline(cin,data); } void dispTst() { cout<<"\nName :"<<name; cout<<"\n Data :"<<data; } int main() { int tmp; cin>>tmp; getTst(); dispTst(); … | |
Hi, plz find my small solution. [CODE][COLOR="Green"] #include <iostream> #include <ctime> #include <string> using namespace std; class cPlayer { public: [COLOR="red"] string Pl_name;[/COLOR] int pos; int pts; }; cPlayer p1, p2; int random(int nMin, int nMax) { return rand() % (nMax - nMin + 1) + nMin; } int main() … | |
Hi, in this code i am trying to call the function "issueTicket" from class "ticket", in the the function "reserveCabin" in another class called "cruise". Also, i think it is the same problem, i am trying to call function "calTicket" from class "booking", in the function "issueTicket" from class "ticket". … | |
i need a sample program how to enter values in a array,display the results, and edit the values that entered. actually i need to make a program to create a database to store students marks and edit the values....... so any one can help with a sample program? | |
How would I, if it's even possible, create an array to read/store the input values from a input text file? Here is what I was thinking, but I want to pretend as if I don't know the amount of values in the file. Input File Has: 21.22, 13.23, 43.12, 123.54, … | |
Hello I am newbie to C++ and I am testing my first loop using a switch statement. I want the loop to run nonstop until the user quits the program. [CODE] #include <iostream> using namespace std; int main() { char answ; cout << "Yes or No(y/n)" << endl; cin >> … | |
Note - I'm still learning c++... so there could be better ways of coding this. Try not to introduce new concepts - this will only aid in confusing me more, but please be more than welcomed to tell that i'm using something incorrectly. [CODE]// Classes - Using class to design … | |
How do I multiply two arrays? Assuming that the numbers in the arrays are all single digit integers, which makes the array a big integer. Now I want to multiply these two big integers formed from arrays and also at the same time display steps. Please don't use multidimensional arrays … | |
Hey, i was reading up on find function and i came across this line. size_t find ( const char* s, size_t pos, size_t n ) const; Correct me if im wrong, but it basically allows us to search a string based on the information inside an array right? After searching … | |
I have been trying to do this assignment for the past 4 days. I thought I was doing good but the functions seem to be screwing up. All the greater than and less than functions are messing up. Also the add and subtract functions are messed up. Any suggestions would … | |
i have a program that generates a grid of 20x20 using a 2d array, it then populates it by randomly generating 2 numbers as co-ordinates, and then filling it with either an 'x' or an 'o' it has a maximum of 5 x's and 100 o's. What i need it … | |
I have never posted to a forum before. I am taking a beginning C++ prgmming class. I am getting the error "error C2181: illegal else without matching if " I have tried everything I can think of to fix it, I can't tell if its a syntax error (such as … | |
Hi, I have a .txt file named: myTextFile.txt on my hostingaccount that contains this string: "Hello" Now my hostingprovider says this: "Any file that you can access via your domain can be accessed through a Secure Socket Layer (SSL) connection as well." When I type this manually in the address … | |
My program is to display a menu choice for the user, they will then pick one of the choices and the program will perform a calculation for the user. It contains four functions (menu, sum, power, and gcd) and it must contain reference parameters...i have most of the program, it … | |
I've got a constructor that sets some floats (x,y,z) and then I have a function called setXYZ. Now the constructor and the function do exactly the same thing. What's the best thing to do in this situation? Should I put the code in the function then call this from the … | |
I saw the following sentences from a book “A difference between a destructor and other member functions is that, if a regular member function has a body at the derived class, only the version at Derived class gets executed. Whereas in case of destructors, both derived as well as base … | |
can anyone help me with this c++ program? its a little much but i would really appreciate it Project specifications: Create a 2-player game that utilizes the “a s d f” and “4 5 6 8” keys on your keyboard. It would be a modified rock, paper, and scissors game, … | |
there are some problems in my coding which showing errors C2664 and C2562. i have no idea how to fix it...wish someone can point the problems and solutions too... [CODE]#include <iostream> using namespace std; const int listSize = 10; void fillArray(int list[],int listSize); void largest(const int list[],int listSize); void printArray … | |
[CODE] #include <iostream> #include <string> #include <iomanip> using namespace std; // //CLASS DECLARATION SECTION // class EmployeeClass { public: void ImplementCalculations(string EmployeeName, int hours, double wage); void DisplayEmployInformation(void); void Addsomethingup(void); string EmployeeName; int hours , overtime_hours, iTotal_hours, iTotal_OvertimeHours; double wage, basepay; double overtime_pay, overtime_extra; double iTotal_salaries, iIndividualSalary; }; int main() … | |
Hi I am attempting to write a code that will input the name of a file and output the number of times each letter appears in the file, and it is case-insensitive.For example : a|A : 5 b|B : 3 c|C : 0 d|D : 7 e|E : 0 so … | |
can anyone point what is wrong with my RegQuerryEx() function? Altough it return 0 :| [CODE] char buff[3] = {0}; DWORD size = sizeof(buff); DWORD type; if(RegOpenKeyEx(HKEY_CURRENT_USER , "Software\\vBx" , 0 , KEY_QUERY_VALUE , &hkey) == ERROR_SUCCESS) { if(RegQueryValueEx(hkey , "log" , NULL , &type , (LPBYTE)buff , &size) == … | |
Hey guys, i am having a huge problem checking the data i input to make sure it is correct. What i am trying to achieve is when i input a value, it will check if the input is all digits and if it is not, check to see if it … | |
I am kind of new to c++, i usually code in java and php. This is a program that is supposed to read in an input file with very strict syntax that will either create a new stack/queue (implemented subclasses of simpleList), or push a value onto one of those … | |
I have been recently experimenting with Python embedding, but I stumbled across some problems. [CODE]#include <python3.1/Python.h> int main (void) { Py_Initialize (); PyRun_SimpleString("print (\"Hello World\")"); Py_Finalize (); return 0; } [/CODE] As you see it is not the most complicated code :). I have compiled in Code::Blocks using g++. I … | |
Hey guys, i was looking through the internet for ways on how to solve converting roman numerals into integers and i found this method which is confusing me as im not able to understand it. [CODE]using namespace std; int main() { char rom; int n = 0; int tot = … | |
Hi all, I've been working with C semaphores for a while using shared memory (ftok, semget, semop, semctl) and it works perfectly. However, I was wondering wether using these structures all processes are protected against starvation. I have made several tests with nearly 200 processes sharing a binary semaphore and … | |
Volunteer C++ Gurus. Thank you in advance for your time. This site has saved my sanity. I am working with my longWords function and cannot get it to stop displaying the same value (2293264). I know that my code is a little janky because I modified it from array format … |
The End.