49,761 Topics
| |
#include<iostream> using namespace std; class area { double dim1, dim2; public: void setarea(double d1, double d2) { dim1= d1; dim2 = d2; } void getdim(double &d1, double &d2) { d1 = dim1; d2 = dim2; } virtual double getarea() { cout<<"You must override this functionn"; return 0.0; } }; class … | |
Hi all, I'm developing an application which helps to manage car park by recognizing the car's plate number. I use VC++, OpenCV, Windows SDK and DirectX in this app. But I'm now having a little trouble with it. Let me introduce a bit about how my system works so that … | |
I got this error when tried to compile.. 1>------ Build started: Project: experiment, Configuration: Debug Win32 ------ 1>Compiling... 1>commands.cpp 1>..\..\..\..\commands.cpp(19) : warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Program Files\Microsoft Visual Studio … | |
Hi i have a task to stores marks for students, a struct is used to store this. the thing giving me trouble at the moment is how to read and store a floating point number within a struct, the data specifically for the mark is on 1 line of a … | |
I am writing a code that is supposed to give the payroll info for a specified number of employees. The user is first asked to enter the employee’s name, hourly wages, and number of hours worked for the week. Then when that is done the employee’s data, which consist of … | |
People, need help with making a web browser! Do anyone know how to add plugins and security features to my web browser? If anyone knows, could you add the code below in VB.Net? And how to mix VB.Net with C++? Needed help really. And how to not "Write the same … | |
I have created a program allows you to input the amount of items purchased, and then input the price of each item and the sales tax. It then creates a receipt which totals all the prices and sales tax. Now I want to be able to list the items and … | |
Hey guys, my first post on here, I need help with setting up basic collision with a program I just did up. I downloaded sfml about an hour ago, and I have a cube I can move around, and want it to stop moving, when colliding with a stationary cube. … | |
i got difficulty here, i dont know how to create a random vector consist of 4 strings. using vector. [CODE]int main () { string red,yellow,blue,green; }[/CODE] i want to create random vector for those four colors. please help me.. -im a beginner for c++ | |
[code] #include "stdafx.h" #include <iostream> using namespace std; int main() { cout << "Hello World!"; cin.get(); return 0; }[/code] Compiles and runs in dev cpp and notepad ++ but not in visual, Im trying to teach myself witht he internet but have no idea why this wont work. [CODE]1>------ Build … | |
I use Code::Block 10.05 I'm starting with some lines of code. No error found when I compiled it. But although I ("run", "Compile this current File","Build") in menu Build, I still cannot debug my program because in menu Debug, ("start", "stop Debug", "next",etc) cannot active :( I have read on … | |
hi, I have been writing a football tournament simulator and I am almost done, however i need to some how sort the teams after a round the put the teams that progress into the next round. The data of the teams is held in structures and have a boolean vale, … | |
I'm trying to execute the following code in netbeans & eclipse but without success. [URL="http://read.pudn.com/downloads150/sourcecode/comm/651136/NmeaConverter.cpp__.htm"]http://read.pudn.com/downloads150/sourcecode/comm/651136/NmeaConverter.cpp__.htm[/URL] Program has command-line parameter: -f D:\nmea.txt Eclipse says: [CODE]Description Resource Path Location Type `endl<<expression error> >' cannot appear in a constant-expression nmea.cpp /nmea/src line 358 C/C++ Problem `std::endl(std::basic_ostream<_CharT, _Traits>&)' cannot appear in a constant-expression nmea.cpp … | |
hi there, i just want to know what function to use in converting a char into an int like: [code] char temp; cout << "enter something"; cin >> temp; atoi(temp); [/code] is this the right way? | |
I am writing a polynomial class and finally got done writing all the functions, set up the main but get an assertion failed _BLOCK_TYPE_IS_VALID(pHead->nBlockUse). I read it has something to do with the going over the size of the heap, but don't entirely grasp that. Any clues? [CODE] #include <iostream> … | |
I have to write a program to "encrypt and decrypted" some text. For example if I input: FACHHOCHSCHULE with a password of: TIGER it should encrypt to: YIILYHKNWTACRI which I got working but when I try to reverse the process I get numbers, letters and symbols. Please help. [CODE]#include <iostream> … | |
This is (supposed to be) a soln for a [URL=http://acm.uva.es/p/v1/101.html]ACM problem[/URL] But the program produces a runtime error. Can anyone spot the bug? [CODE] #include<iostream> #include<string> #define MAX 25 using namespace std; void print_blocks(); int return_initial(int a);//return all the blocks //on top of block a to their initial pos int … | |
[CODE]void SubGen(char* s) { //rearrange s ... for(int i=0;i<strlen(s);i++) { for(int j=i+1;j<strlen(s);j++) { if(s[i]==s[j]) { char temp=s[i+1]; s[i+1]=s[j]; s[j]=temp; } } } //s arranged.... Sub[0][0].push_back(s[0]); for(int i=1;i<strlen(s);i++) { if(s[i]==s[i-1]) { vector<string> temp; for(int j=i-1;j<Sub.size();j++) { for(int p=0;p<Sub[j].size();p++) { temp.push_back(Sub[j][p]); } } for(int j=0;j<temp.size();j++) { temp[j].push_back(s[i]); } Sub.push_back(temp); } else { … | |
[CODE] vector<vector <vector<char>>> Sub; Sub[0][0].push_back(s[0]);Sub[0][0].push_back('\0'); Sub[0][1].push_back('\0'); [/CODE] I have the above code and it says "vector subscript insaccessible" for the assignments.What could the reason? Thanks in advance, Prasanna | |
Hi guys, I just finished doing my homework assignment on spanning trees and I wanted some reassurance that I've done it correctly. I'm not looking for someone to state a correction, but rather let me know I've made a mistake (if I have). Here are my edges for [B]Prim's Algorithm[/B] … | |
Hi I came across this question in C++ Primer by Stanley Lippman. [CODE] int main() { const char ca[] = {'h', 'e', 'l', 'l', 'o'}; const char *cp = ca; while( *cp ) { cout << *cp << endl; ++cp; } } [/CODE] According to me, this code should produce … | |
hi guys, im currently working on playfair cipher. However i got a serious problem in implementing it on certain conditions You can find background information here [url]http://en.wikipedia.org/wiki/Playfair_cipher[/url]. The problem im facing is that when Playfair cipher decrypts by bigrams and encounters the same character e.g 'ee', my program adds a … | |
Hi everyone I'm working on a remote controled robot which have four cams & one sound recorder. the robot encode the data send it to a computer, an Application decode data and view 4 cams & play sound. Here are my questions 1. Must I write a new codec(encoder/decoder) to … | |
Hello Everyone. My name is Ashfaq, working as embedded software engineer. I am currently working on a medical device with C++ as the language for application development. I am just loving this language and would like to master it (need your help Guys!!!). My hobbies are surfing internet, travelling, reading … | |
Just for exercise, if people want to give it a go; see how creative one can be. [b]Problem Statement:[/b] Given a list of data from a file( or user input which ever) as such: [code] char 1 char 2 char 26 char 27 char 52 char 53 [/code] output the … | |
I want to create my own widget toolkit, and I know it's possible without external tools(QT was written in C++, and so was wxWidgets). But I don't know how to do it, and I couldn't find anything in Google. So how exactly do I create GUIs in C++ that way? … | |
Ok, my problem is that I'm reading from a file 3 values, a last name, first name and salary, for example: Key Bobby 43000 I have an array of objects for each person, so I neeed to read this file and assign the last name, first name, and salary to … | |
hello, i'm trying to write two classes (vehicle and driver) first i want to create the class vehicle and it's attrbutes, but there is a problem when i compile the code. please see all my code [CODE]#include<iostream> #include<vector> using namespace std; // // Vehicle: Vehicle number, type, capacity, driver assigned … | |
Hello, I have to make a small game in C++ as a school project. Now, although I've made many 2D games before I'm very new to C++, and I ran into a few problems. One: I need dynamic key input. I now use getch() and it makes the program wait … | |
Ok, so this is how things stand now. I've read few books about C++ console programming, C++ console game programming, I'm doing C++ on school and I can say I'm pretty good at it. Now, I'd like to move on the next step, to program in C++ with graphics, sound, … |
The End.