49,761 Topics
| |
Hello, As may be apparent from my previous posts, I am in a "If its worth doing, its worth overdoing" sort of competition with a friend of mine. Our goal is arbitrary precision integer arithmetic. I think I am close to getting the data storage working, but now I want … | |
Ive actually managed to get DirectX 9 working with Direct X, however i am now getting odd error messages around a function. I can't see any syntax issues myself but thought i'd check to see if anyone can shed any light on it. `g_pd3dDevice->CreateVertexBuffer( 3 * sizeof(CUSTOMVERTEX) , 0, D3DFVF_CUSTOMVERTEX, … | |
//Author: Frank R. Mendez //Title: Object Oriented Bubble Sort //Description: Accepts an int array element to sort using bubblesort in ascending order #include <iostream> using namespace std; class BubbleSort { public: void bubble(int arr[], int size); void driver(); void display(); int arr[50]; int array_size; int temp; }; void BubbleSort::driver() { … | |
i am trying to create acalcultor using a c++ program that uses mode. would you please show me how to create a calcultor that uses the mode function using a switch a statement | |
| Hello everyone, I have a 2D array as follows: `double cornerPoints[4][3];` which is used to determine the four corners of a 2D bounding box of a curve. However, since I do not know how many curves are to be processed, I would like to dynamically allocate memory, knowing that the … |
This is the code which put an extra line to the std::string array. I am here trying to print last k lines of file. Any help is appreciated. #include <iostream> #include <fstream> #include <string> using namespace std; //file.exceptions(ifstream::eofbit | ifstream::failbit | ifstream::badbit); void print_last(unsigned k, string file_name) { string *data=new … | |
#include <iostream> #include <string> using namespace std; class Point { int x; int y; public: Point(int seed = 0) : x(seed), y(seed) { cout << "Overloaded constructor called.\n"; } ~Point() { cout << "Destructor called.\n"; } int getX() { return x; } int getY() { return y; } }; ostream& … | |
Im having difficulties in performing the frequency distribution of 6x6 matrix which was given..i solved it by the following way but it was wrong anyway because if i change any number in the matrix it will not calculate the number of times it occurs in the array.... need your kind … | |
these is my problem. the user enter the password and the computer output "congratulation!" if the user guess the assigned password otherwise "try again!" how could i run these program. feedback a.s.a.p. thanks. | |
class A { public: protected: int i; }; class B : public A { friend void f(A*, B*); void g(A*); }; void f(A* pa, B* pb) { // pa->i = 1; pb->i = 2; // int A::* point_i = &A::i; int A::* point_i2 = &B::i; } void B::g(A* pa) { … | |
//Author: Frank R. Mendez //Title: Object Oriented Queue //Description: This is program uses double linked list to store data in the queue its functions are enqueu,dequeue and display queue. //Hope it can help you in you future projects. Good vibes to all programmers! #include <iostream> using namespace std; struct Node … | |
Kambo company pays employee Gratuity on retirement that can be computed using the Formula Gratuity=(Salary*Fixed Rate*Number of Years Worked)+One month Salary. Formulate an algorithm that can be used to calculate the gratuity and write a c++ program that can be used for the computation. | |
I am almost done with my assignment but am having problems with the spacing when I echo the file. Any help please? this is what I have: #include <iostream> #include <fstream> #include <string> #include <iomanip> using namespace std; int main() { //Declare variables to manipulate data char reply; string name; … | |
| Hi, This question is related to the below. http://www.daniweb.com/software-development/cpp/threads/352685/error-c3861-menu-identifier-not-found I used that to solve my issue. What I would like to understand is why the function prototype is to be declared before the main function? In my textbook that I am following the function prototype wasn't there. I did as … |
I stumbled upon the fact that one can't bind a temporary variable to a reference unless it is a constant and found it to be indeed true in the given code. However, i am not able to find out the difference in my other code snippet where I didn't use … | |
I have 2 processes (producer and consumer) sharing an int deque in shared memory, I have the producer process put 2 numbers in the deque and then it gets in a wait state losing its mutex lock. I then have the consumer process removing the numbers and printing them. It … | |
How to Make a Program in Array that have 3 rows and 4 columns and the User Should Input the Data or Values | |
| I use visual c++ compiler 2008 express edition, because express edition doesn't support resources is it possible to make a win32 dialog box in express edition, if so how might I create one? Thank you for reading |
Hello, I am having a few problems when trying to execute the a Makefile that will *hopefully* create a static library that I can use for future use. Here is my code below: #----------------------------------------------------------------------------- # Usage of make file #----------------------------------------------------------------------------- # Clean operation: # make -f MakeClient clean # # … | |
Hi there, I'm just new to programming and C++ ... I have trouble with my code At first I am using "int" for variables but then I realize that i need a much larger range of numbers and also support for decimal operations... My First Code: #include <stdio.h> #include <conio.h> … | |
// Author: Frank R. Mendez // Title: Object Oriented Calculator Program // Date: 7/13/13 #include <iostream> using namespace std; class Calculator { public: void add(int i, int a); void subtract(int i, int a); void mult(int i , int a); void divide(int i, int a); void modulo(int i , int a); … | |
This code only print characters until char value is 0 but surprisingly it output characters only upto first blank space. I checked their ASCII values and surprisingly ASCII value of space(' ') character was output by program as 0. I couldn't get it. Any help is appreciated. #include <iostream> #include … | |
I keep getting this error on a sample that a c++ book provides. " **error C2660: 'std::vector<_Ty>::empty' : function does not take 1 arguments 1> with 1> [ 1> _Ty=std::string 1> ** ] " I have some suspicious what can be causing the error but I am not sure. the … | |
Hi everyone.. Would anyone know where I could find a good explanation on 'Pipes' in programming. I'm trying to understand how I might go about using input into a GUI application to display output in a dos console. As I understand it, the concept of pipes comes into this somehow. … | |
hi.can someone help me to sort a two dimensional array.. below is how i sort a single dimensional array, i want it in a similar way... im just not good at managing the for loop... single array : #include <iostream> using namespace std; int main () { int M[5] = … | |
ls -1 | grep ".h$" -> searches backwards findfirstchar '.' for file-type h [ C++ Header file ] ls -1 | grep ".cpp$" -> searches backwards findfirstchar '.' for file-type cpp [ C++ Source file ] etc... | |
Hello everyone! I would like your help regarding this: I have a tuple vector which i must iterate through, and accessing the vector data to decide wether to erase or not the current vector element. My code : typedef tuple <int, CString, int, int> pc_data; vector <pc_data> pc_vec; //Assume that … | |
I intend to perform in-place modification of std::string with the help of a modifier function. In this regard, I looked up on internet and found that pass by pointer method is not recommended. I have few queries in this regard. * If I pass a std::string to the function as … | |
I was using C++. As I was a beginer, I wanted to make some changes in the program. But when I tried doing so, the blinking cursor was erasing the other charcaters. So, can anyone kindly help me out in this problem as soon as possible. I'm in very urgency, … | |
The End.