49,755 Topics

Member Avatar for
Member Avatar for SCass2010

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, …

Member Avatar for mike_2000_17
0
2K
Member Avatar for Valiantangel

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 …

Member Avatar for gusano79
0
128
Member Avatar for sharath_137

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.

Member Avatar for Banfa
0
589
Member Avatar for Lucaci Andrew

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 …

Member Avatar for Lucaci Andrew
0
167
Member Avatar for pkfx

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.

Member Avatar for deceptikon
0
100
Member Avatar for ddm

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 …

Member Avatar for MonsieurPointer
0
96
Member Avatar for smarty_t2

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 …

Member Avatar for ravenous
0
2K
Member Avatar for dinosaur123

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 …

Member Avatar for VernonDozier
0
403
Member Avatar for risen375

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; …

Member Avatar for histrungalot
0
126
Member Avatar for caltech

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 …

Member Avatar for mike_2000_17
0
359
Member Avatar for vedro-compota

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 - …

Member Avatar for WaltP
0
167
Member Avatar for DAlexNagy

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 …

0
121
Member Avatar for bobanderson90

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]; …

Member Avatar for mike_2000_17
0
1K
Member Avatar for dshiells

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 …

Member Avatar for dshiells
0
2K
Member Avatar for jonnyboy12

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 …

Member Avatar for Milton Neal
0
82
Member Avatar for native99

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 ); …

Member Avatar for Banfa
0
241
Member Avatar for triumphost

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.

Member Avatar for triumphost
0
397
Member Avatar for mayank.dyl

Without using /,% and * operators. write a function to divide a number by 3, itoa() function is available.

Member Avatar for mayank.dyl
0
305
Member Avatar for sandz24

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 …

Member Avatar for raptr_dflo
0
912
Member Avatar for Z33shan

hello :) i'm looking for some good Combination Optimization Algorithm, which is easy to code aswell... (combination optimization algorithms like "Hungarian Algorithm", etc.) thanks :)

Member Avatar for Z33shan
0
145
Member Avatar for SAM2012

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 …

Member Avatar for emilo35
0
171
Member Avatar for ashboi

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> …

Member Avatar for ashboi
0
159
Member Avatar for TheFearful

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 …

Member Avatar for DeanMSands3
0
114
Member Avatar for dellskiisays123

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 …

Member Avatar for Z33shan
-1
118
Member Avatar for BryantFury

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 …

Member Avatar for ravenous
0
522
Member Avatar for Valiantangel

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;}

Member Avatar for WaltP
0
110
Member Avatar for BryantFury

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"); } …

Member Avatar for BryantFury
0
94
Member Avatar for infogirl

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 …

Member Avatar for mrnutty
0
151
Member Avatar for stevthym

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> ! ...! …

Member Avatar for WaltP
0
254
Member Avatar for oscargrower11

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 …

Member Avatar for oscargrower11
0
178

The End.