49,755 Topics
![]() | |
Hi everyone, Wondering if anyone could help with a minor problem... I have a class that contains a std::map that stores pointers to various objects as a void pointer and a name for the object, so within the class I have a template function where the object type is passed, … | |
int main() My code works fine...i will be using const later ,hence my variable are capital letters.What i need a little help is when the NUM_VALUE is negative.If i am not wrong its call integer division error.(where one or more operand is negative.How can i avoild this? I inserted under … | |
hi, Can anyone tell me the exact difference between memset,malloc and calloc.I am new to c++, Know this is simple question to ask in c++ but i am getting lot of confusions in using them and i want to knw whr exactly i can use these. Regards, Sharath. | |
Hi. So my problem is that I can't save into a vector throughout a function, but I can save directly in the vector. /* * asd.cpp * asd.cpp is licensed under GNU GENERAL PUBLIC LICENSE * Created on: May 3, 2012 * Author: sin */ #include <iostream> #include <string> #include … | |
ive declared and integer array and i need to know how the user can input a single input of "2 4 6 3 5 6 7 5 3 5 6" and get each individal digit into each index of the array and help would be greatly appreciated. | |
Design a CPU Timer class (you may name it CPUTimer). This class should allow the user to start timer, stop timer, compute delta time and print the lapsed CPU time of any block of code in a program. #pragma once #include <iostream> #include <cmath> #include <ctime> #ifndef CPUTimer_h #define CPUTimer_h … ![]() | |
I wrote a program in C# for my discrete mathematics class and it worked absolutely fine. My teacher asked me to submit the code in c++ so she can run it on her mac and so I created a new project and typed the code in. After changing everything required … | |
Hello, I am having trouble with a program I am writing. The problem is that I need to take information from a text file, read it, and then output the information into another text file. I keep getting this output: > <ProductSummary>0015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A00015D7A0 </ProductSummary> I need it to output something like … | |
Hi I need help with this program. When I run this program, it will not print out the correct kilograms which always displays 0. Please help #include <iostream> #include <istream> #include <iomanip> #include <vector> using std::vector; using namespace std; using std::endl; using std::setw; struct PatientInfo { string name; double weight; … | |
Here's my code. (Lines of interest: 49, 138, and 162; rest of the code works fine.) #include <iostream> #include <iomanip> #include <fstream> #include <vector> #include <algorithm> #include <cstdlib> #include <conio.h> using namespace std; class Records { public: string name; int hours; double rate; int age; double pay; double tax; double … | |
hi there) my brothers-programmers) please tell me - how to get double type character by character - i need make custom realization of fprintf - so it's necessary for me to show double type numder on the screen. (For integer type this problem could be solved by subtracting 32 - … | |
Hi all! I am looking for some advice on how to best design C++ programs that read, write, and update data in MySQL databases. I have completed a system that successfully does this but I'm not sure if I designed it the right way to take advantage of OOP principles … | |
I want to push a value to a stack using the assignment operator, I need some help with this.. Thanks Stack s; float x = 5; s = x; class Stack { public: Stack(); float push(float value); float pop(); int Size(); float operator = (const float &right); private: float values[30]; … | |
Hi all, I'm sure this is a n00b question, but I can't seem to get my head around it! I have a 4 BYTE array which I want to display as a decimal value. For example, in the array it contains the hex values: 00 05 7d a4, and I … | |
Hello I have a large project that i bult with windows forms. When I drag a form on my screen it will move with no problem. When part of the form is overlaping the edge of my monitor and i try to drag it , the form will shutter when … | |
i'm building a simple code in wdk in "native subsystem" i have a library that overload new and delete operator here is the code: header file #include<ntddk.h> #define HEAP_ZERO_MEMORY 0x00000008 #define HEAP_GROWABLE 0x00000002 typedef NTSTATUS (NTAPI * PRTL_HEAP_COMMIT_ROUTINE)( IN PVOID Base, IN OUT PVOID *CommitAddress, IN OUT PSIZE_T CommitSize ); … | |
I have an application that will be minimized and running in the background. I want this application to have it's own moveable mouse so that it does not use my current mouse. How can I accomplish this? I'm not exactly sure where to start to create a mouse for it. | |
Without using /,% and * operators. write a function to divide a number by 3, itoa() function is available. | |
Hello everyone and good day!!! I'm trying to embedd an image watermark to another image for copyright protection and I plan to use DCT and embedding the watermark in the middle band coefficeint of the host image. The problem is I don't know which of the formulas to use since … | |
hello :) i'm looking for some good Combination Optimization Algorithm, which is easy to code aswell... (combination optimization algorithms like "Hungarian Algorithm", etc.) thanks :) | |
I have queue class as below public class queue { public: queue(); ~queue(); bool Empty() const; void Enqueue(message^); void Dequeue(); void DisplayAll() const; private: gcroot<String^> bindingkey; queue(queue const& obj); ListNode* head; ListNode* tail; }; queue::queue():head(nullptr), tail(nullptr) {} queue::~queue() { while (head != nullptr) { Dequeue(); } } //bool queue::Empty() const … | |
I'm getting some errors with my code, & cant seem to find where the problems are. Basically I'm making a student class that calls out the student id & name. I hope someone can point me in the righ direction to get this code working. Thank you student.cpp: #include <iostream> … | |
Hello everyone. I have a declaration that starts off like this inta data[100]; size_t i; I have to write a C++ segment code that will shift data[50] and data[98] up one spot to the locations data[51] and data[99] Then I am supposed to insert the number 42 in data[50] Any … | |
i have trouble starting my final project for my C++ class and heres the layout of the first part.. Command Line Text Editor Part 1: 50% Create a command line editor to and edit files. Each file only needs to be one line long. When launched, the editor shows a … | |
i have a code to read some products from a file.(.dat). it hasthe name, model number, price and its purpose. example. = knife 103 10 cut currently it can read the first 3. The question asks i make a derived class to read the purpose. Here is my code #include … | |
how do u convert the below to a 'for' loop? int x = 123456; int y =0; while (x > 0) { y *= 10; y += x % 10; x /= 10;} | |
Hi im trying to learn polymorphism and i stumbled upon a question. Polymorphism to me means 1 with many forms. here is my code: // virtual members #include <iostream> using namespace std; class CPolygon { protected: int width, height; public: void display(); virtual string area () { return ("FIRST"); } … | |
Hello, guys. This is the fragment of my program. I can't initialize the dynamic two-dimensional array. The compiler says to me that 'y' cannot appear in a constant - expression. But I need that both x and y to be dynamic. How can I fix that? ` float a; int … | |
Hi! I am working into the development of a C++ related Phone Management System where the request is to: 1. Input information of new subscriber: The program should input a line of data from the keyboard in the following format: <surname> <name> ! <telephone1> <mode> ! <telephone2> <mode> ! ...! … | |
I just can't help but feel that there's a more efficient way to do this than with multiple calls to the string[i] operator. I've tried storing the results of string[i], but that leaves me with a char, which I'm evidently unable to compare. I know that I can compare a … |
The End.