49,761 Topics
| |
Assume that the following data is stored in file “data.txt”: 2 5 7 1 12 -999 1 4 11 55 66 3 43 23 -999 9 87 56 34 22 12 21 -999 8 7 5 4 6 111 -999 The number -999 at the end of each line acts … | |
Display a product number, name (or description), and price for four retail products. They could be food, clothing, auto parts, plants, tools, kitchen utensils, or any other type of retail product. Prompt the user to enter the product number of each product they wish to buy, one at a time, … | |
The program runs but I can not get it to add the totals from the three employess. Then when i enter an employee info the totals show after each employee instead of the end. Please help. If you can please explain what I need to do in simple terms. Its … | |
Hello, I'm looking for some advice (NOT CODING) on a project I'm hoping to start.. Basically, I'm hoping to develop some shell commands that work a tiny bit like Github (if you are familular with it).. The language that I want to use is C++.. Could anyone offer any advice … | |
i was told tht from this: int main () { int i,j,vsota; for (i=1; j=10; i<=j; i++) { vsota=vsota+i+j; j--; } system ("pause"); return 0; } i must make it work with while ; but the oruginal doesnt work allso what should i doo??; please any help;? #include <iostream> using … | |
Im getting these errors, what do they mean? its DEFINITELY not my code because it works when i compile it in codeblocks but not in microsoft visual c++ 2008. 1>------ Build started: Project: DropBlock, Configuration: Debug Win32 ------ 1> player.cpp 1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(43): error C2065: 'blocks' : undeclared identifier 1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(43): … | |
hey i have this error The debugged program raised the exception unhandled RuntimeError "underlying C/C++ object has been deleted" the code is: class qthread(QtCore.QThread): def __init__(self, x, y, z): self.x=x self.y=y self.z=z self.name="" self.m=hashlib.md5() def changeresultsig(self, text): self.emit(QtCore.SIGNAL("changeresult(text)"),text) def conssig(self, text): self.emit(QtCore.SIGNAL("cons(text)"), text) def enablesig(self): self.emit(QtCore.SIGNAL("enable(")) def disablesig(self): self.emit(QtCOre.SIGNAL("disable()")) def … | |
i have this problem to write and read data, here's what im trying to make : Write a program that uses a structure to store the following inventory data in a file: -Item Description -Quantity on Hand -Wholesale Cost -Retail Cost -Date Added to Inventory The program should have a … | |
Hello everyone! I want to monitor my network using wireshark 's tshark command line tool. What i want to accomplish is to redirect tshark's output to a c++ application, so i can examine data and output a more comprehensive analysis without keeping a huge amount of data. I am working … | |
Hi! In my program I have to calculate the Adler32 checksum of a file, but I've a problem in using this algorithm. The function prototype is: unsigned long adler32(unsigned long adler, const char *buf, unsigned int len); I know how to calculate the Adler32 checksum of a string, but in … | |
Hi, I am using curl to download files from the internet and it is working fine. The problem is that I am trying to check if the file exists before downloading it. I was thinking that if the file doesn't exist, then I would receive a CURLcode with and error, … | |
hi its me again, same program new problem... been working on this all day and i just cannot get it to work. #define INVENTORY_H #include <iostream> #include <iomanip> #include <string> #include <istream> #include <fstream> #include <vector> #include <ctime> using namespace std; class Inventory { private: static const char *Error[]; static … | |
Hello :). How can I fix this? Yes, I can write 2 functions (with and without parameter) ... but what is bad there? #include <cstdlib> #include <string> #include <iostream> using namespace std; class CClass{ public: void foo(string & s = "default"); // COMPILE ERROR string backup; }; void CClass::foo(string & … | |
hello, i am new to this site but i have used it as reference before. this is a program for one of my classes and i have everything done down to one error... error LNK2001: unresolved external symbol "private: static char const * * Inventory::Error" (?Error@Inventory@@0PAPBDA) 1>C:\Users\Joey\documents\visual studio 2010\Projects\JHabura PA … | |
Hi :). I use this code to create a file: #include <cstdlib> #include <fstream> using namespace std; int main () { ofstream file("main/articles/giraffe/article.txt", ios::out); file.close (); return 0; } How can I simplify **create path of folders** (on **unix system**) "main/articles/giraffe/" - if folder "main" doesn't exist? With using standard … | |
I have a declaration of a 2d vector: vector<vector<int> > data; I want to add several times in an server-client problem an array of 25 elements. I donnot know how many times i must add that array(which changes its values). How can i add that element to the vector without … | |
so i made this code that asks the user about corporate's data(division's name, sales, etc) #include <iostream> #include <string> #include <fstream> using namespace std; const int SIZE = 4; struct Division { string name; string quarter[SIZE]; double sales[SIZE]; }; void getData(Division []); int main() { Division corp[SIZE]; for(int count = … | |
#include<fstream> #include<iostream> #include<string> using namespace std; int main () { struct Candidate{ char RegNomer[4]; char name[60]; char party[60]; char age[3]; char xp[3]; long int votes; }candidate[200]; int i=-1; int i1=0; int check=0; char choice[1]; while (true) { system ("cls"); cout<<"/============\\=/============\\=/============\\=/============\\=/============\\ "<<"\n"; cout<<"| save | | create a | | banned … | |
Ok I started writing this program for a school project in Eclipse in windows and now shifting to vim in UNIX and I am getting a bunch of errors. I am currently trying to figure out the top two errors (And yes the funky characters are what I see). Here … | |
**Hello, If I have an array, and want to make a heap tree out of it using make heap and sort heap, how would I do it? I'm struggling because I didn't take any course in data structure. Any help -in c++- will be appreciated :D** | |
hello everyone, i've trying to make a simple object(e.g. a simple robot with arms and legs) in openGL..but i've trouble finding how to write all the vertices within the code..is there any tool we can use to develop the objects separately..and drag the vertice co-ordinates into my program?? thank you | |
Hi there, I'm writing some application based on Qt and C++ and I've reached the problem. How to display window via clicking, triggering, etc. I wrote some code: //---------------------------- // THIS IS IN mainwindow.h //---------------------------- #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> namespace Ui { class MainWindow; } class MainWindow : … | |
Quickselect, based on quicksort, and counting select, based on counting sort. Each is capable of finding the kth smallest element in an unsorted/sorted list/array. This is some example code for a QuickSelect algorithm. This doesn't include the partition function. // return the kth smallest item int quickSelect(int items[], int first, … | |
The title explains it well. I wish to know which variables I need to delete when my program closes. I assume you don't have to use the delete keyword on *every* variable that you initialize. Thanks in advance. | |
Hello ladies and gents, Was wondering if any of you could help me out, how can I count the amount of numbers(digits) there are in one integer, for example: int integer = 123; integer has three digits. int secInteger = 10; secInteger has two digits. The reason for asking is, … | |
Hi everyone, At the moment I'm trying to create a class that contains a DOMNode* pointer, something like this class MyDOMNode { public: MyDOMNode (DOMNode* node) : mDomNode (node) { } bool operator== (const MyDOMNode& rhs) { if (mDomNode == rhs.mDomNode) return true; return false; } bool operator!= (const MyDOMNode& … | |
I'm just wondering if the below is true? I pulled this from another forum. Does this mean that a application using qt4 can be built and used in a bank without getting permission or paying fees for it's use? *The Framework is freely available for Windows, Linux, MacOS X, and … | |
#include <stdafx.h> #include <stdlib.h> #include <windows.h> #include <GL/glut.h> using namespace std; int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0; int rumus(int x1, int y1, int x2, int y2, int x){ int y=(x*(y2-y1)+x2*y1-x1*y2)/(x2-x1); return y; } void tampilkan() { glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClearColor(0,0,0,0); glLoadIdentity(); glBegin(GL_QUADS); glColor3f(0.0,0.0,1.0); glVertex2d(2,2); glVertex2d(5,2); glVertex2d(8+c,11); glVertex2d(7+d,rumus(7,14,2,11,7+d)); glEnd(); glBegin(GL_QUADS); glVertex2d(7+e,rumus(7,14,5,11,7+e)); glVertex2d(9+f,rumus(9,14,2,11,9+f)); glVertex2d(14+g,rumus(14,2,2,14,14+g)); glVertex2d(11+h,rumus(11,2,5,14,11+h)); … | |
I was following [this tutorial](http://www.swiftless.com/tutorials/opengl4/1-opengl-window.html) for my first attempt at OpenGL. All I'm doing is initializing an empty window. His VS 2010 code is [here](http://www.swiftless.com/?download=1%20-%20OpenGL3%20-%20Window). Using Dev-C++ as my IDE on Windows 7, and MS SDK 7.1, I get this error: [Linker error] undefined reference to `_imp____wglewCreateContextAttribsARB' ld returned 1 … | |
hi, i have this problem about reading the file's content from the back Write a program that asks the user for the name of a file. The program should display the last 10 lines of the file on the screen (the tail of the file). If the file has fewer … |
The End.