49,761 Topics
| |
So I am writing a cash register program, person buys items and the number calculates. But I am stuck at looping, I want the user to pick to pick all his/her items first then after all the program is done I want the program to ask if the user wants … | |
This program accepts the name and ID of chess competition contenders. It then randomly assigns a pair of contenders to play against each other. The program predicts the result of each pair by a random result prediction function. The program then continues to pair the winners in the same method … | |
Hi I have a keylogger code which writes the keys but does not write capital letters and such that:! @ # $% ^ & * () + Someone help me with this? Here is a keylogging code: #include <iostream> #include <windows.h> #include <fstream> using namespace std; ofstream out("plik.txt", ios::out); LRESULT … | |
Hi, Please help me debug this code. I made a Stack template with two parameters: type and size. I am using it two times: first in conversion from infix expression to postfix (here, <char,50> stack is used), then in evaluation of postfix expression (here, <long double, 50> stack is used). … | |
Hey, I want to build some form application for Windows and i have tryed usind VS2010 but because IntelliSense is disabled for C++ i'm not able to work normaly as i'm fairly new to programming and i need to see the drop out menus after i use the "->" operator. … | |
I have made this RSA encryption program but it crashes when it is finished decrypting the line. What is wrong and how can I fix it? #include <iostream> #include <string> #include <cmath> using namespace std; bool IsPrime(int p); int main() { int p, q; int n, phi; int e, d; … | |
I would find Inverted matrix A ... (A)-1 can you help me? | |
#include<iostream.h> #include<conio.h> #include<stdio.h> #include<process.h> struct room { char type[3]; int rmn; int terrif; }; void add(room *,int); void main() { clrscr(); int n,r,modifychoice,c,a,i; room rm[5]; cout<<endl<<endl; while(1) { cout<<"\t\t\t"<<"HOTEL DAVIANS"<<endl<<endl; cout<<"\t\t "<<"MENU FOR HOTEL DAVIANS -"<<endl; cout<<"\t\t"<<"1. Enter rooms record for the hotel "<<endl; cout<<"\t\t"<<"2. Modify rooms records"<<endl; cout<<"\t\t"<<"3. Check … | |
Hello, In trying to port some Java code to C++ I'm disliking the std::stream's lack of copy constructors. I know exactly what the problem is, but I don't know what I can do about it. I have a dangling reference to a stream as a member variable of a class. … | |
actually, I am new to C++ , although not new to programming. i have a vector of pairs , vector<pair<double, pair<int,int> >> and i want to sort it in incresing order. for simplicity, i am using sort() inbulit function. does pair has ibuilt '<' operator ? or we have to … | |
Say I have this class #include <iostream> using namespace std; class Test { int x; public: int GetMax(int a, int b); }; int Test::GetMax(int a, int b) { x = a > b ? a : b; return x; } int main() { // Pointer to class Test *t; int … | |
So here's the question I've been assigned to and I seriously need help with the C++ coding. Please **Airline Seat Reservation System** A small airline has just purchased a computer for its new automated reservation system. You have been asked to program the new system. You are to write a … | |
I am beginner in c++ programming however I have tried to run my code but I got error and Idonot understanding can you help me thanks:) this is my code #include <iostream> #include <string> #include <fstream> #include <sstream> #include <vector> #include <conio.h> #include <iomanip> #include <map> #include <algorithm> #include "Student.h" … | |
The function i am writing below is made to time how long it takes to process a function. // return type for func(pointer to func)(parameters for func), container eg.vector clock_t timeFuction(double(*f)(vector<double>), vector<double> v) { auto start = clock(); f(v); return clock() - start; } This is the function i want … | |
I'm having a bit of a problem and I cannot figure it out. It seems as though code will only write to one keyname I have an inifile [section] key1= key2= key3= And my code Class I'm using from http://www.codeproject.com/Articles/10809/A-Small-Class-to-Read-INI-File stringstream ss (stringstream::in | stringstream::out); CIniWriter MyIniTest(".\\test.ini"); char out[20] = … | |
hey guys so i was thinking of how i would make a program that would state the alphabet from a-z in capitols then the program would change it all to lower case one at a time. btw i would like to use pointers | |
i want to convert this program to read it in c-free (C++) plllllllzzzz i need this now !! thanx all #include<stdio.h> #include<math.> using namespace std; float x[20], y[20]; void get_corners(int n, float x[], float y[]){ int tempx,tempy; for(int i=0; i<n; i++) { cout<<"Enter (x, y) for point "<<i<<endl; cin>>tempx; x[i]=tempx; … | |
can anyone please help me in the sort function ? i have read that there are 3 way to use sort(). 1. use sort(v.begin(),v.end()) and second is sort(v.begin(),v.begin()+n, cmp) then in cmp i can have 2 varaitions, 2.a : cmp as the function (it is okay with me) 2.b. here … | |
I have 2 classes. AddressBook and SingleAddress. AddressBook is supposed to contain SingleAddress. I'm omitting the #include and some of the extra functions. Here's SingleAddress.h class SingleAddress { private: string lastName,firstName,strAdd,city,country,email; int postCode,homeNum,mobileNum; public: SingleAddress( string s1,string s2,string s3, string s4,string s5,string s6, int i1,int i2,int i3); string toString(); }; … | |
Please bear with me, this is my first post So, I have this superclass called A. And I've 2 subclasses A1 and A2. A has attribute name. A has function toString(). A1 inherits name, and has attribute hair. A1 has a method toString() which goes: string A1::toString(){ string stringA= A::toString(); … | |
Hello guys i want to know how i can get the words in C++ like (a,b,c,d,f.....) im making dice game and when player will put word instead of number to tell him "You need to enter number!" #include <iostream> #include <ctime> using namespace std; int main() { int dice; int … | |
[B]Introduction[/B] Hello everyone. This little code snippet shows you how to read in scan codes from the keyboard. It is slightly different than reading in a regular character. When you use the [INLINECODE]getch()[/INLINECODE] function, it is normally returning an ASCII value. Some keyboards have extra keys though. These include the … | |
So if you want to send a text file to some you would use: Client: char* rbuffer; //will save file content here ifstream file; file.open(filepath, ios::in | ios::binary | ios::ate); //open file if(file.is_open()){ file.seekg(0, ios::end); size = file.tellg(); //file size! cout << "The file size is " << size << … | |
I have this RSA encryption code but it doesnt encrypt the whole message its suppose to encrypt. It only encrypts #include <iostream> #include <string> #include <string.h> using namespace std; // prime numbers int p, q; //compute int n ;//= p * q; //totient int phi;// = (p - 1) * … | |
hey.... im supposed to make a school project using files and graphics..my topic is telephone directory.if i have to delete a particular entry,should i keep making a new file or is there any alternative with regards | |
Hi, Let me preface this by saying I'm about 4 days into learning MSVC++ 2010. I just need a little program that takes in a string, puts it in an array and I'd really like it to display it on the screen as the data comes in (1089 strings per … | |
Hi I'm creating a socket server in Linux using pthreads. I was just wondering, how does the server send specific messages to its clients (for instance, a PM) if each is in its own standalone thread? | |
My project compiles fine, but when running a push_back on a vector, I'm getting an access violation when the vector attempts to resize itself. I have lots of code, but hopefully I can boil it down to just relevant classes. I am sorry about the HUGE amount of code, but … | |
how do you link functions written in other computer languages with a C/C++ program? this is in a past paper , & i can't find it anywhere? helps | |
I am working on a Windows application, and I have a Settings Dialog box with 5 text fields. I currently get the values of each text field with: GetDlgItemText(hDlg, IDC_EDIT_SIPADDRESS, sipAccount->sipAddress, 80); GetDlgItemText(hDlg, IDC_EDIT_USERNAME, sipAccount->userName, 80); GetDlgItemText(hDlg, IDC_EDIT_PASSWORD, sipAccount->password, 80); GetDlgItemText(hDlg, IDC_EDIT_HOST, sipAccount->host, 80); GetDlgItemText(hDlg, IDC_EDIT_STUN, stun, 80); And then … |
The End.