49,766 Topics
![]() | |
Hi, I am trying to implement a Data Manager class (singleton) that initializes data, keep track of memory usage and acts as a data pool for other classes to share the data. My problem lies with the sharing. After considering serveral factors, I want to share data in the form … | |
/* Write a program that reads two integers num1 and num2 from the user, then displays the total of the all of the numbers between num1 and num2 (inclusive). Your program should handle the following: 1. Make sure the numbers entered are between 0 and 100. 2. Make sure the … | |
I have received a library in dll format with a .h header file. When I instantiate an object from one of the classes I get an access violation error. It is a run time error; the program compiled bug free. The program even runs. It is just at the exact … | |
Im following an SDL tutorial and I seem to receive these errors when building.. First-chance exception at 0x68129afb in Hello World2.exe: 0xC0000005: Access violation reading location 0x00000004. Unhandled exception at 0x68129afb in Hello World2.exe: 0xC0000005: Access violation reading location 0x00000004. I dont know what im doing wrong but VC points … | |
I have been following an SDL tutorial. This is my code followed by the errors. [code=c] //The headers #include "SDL.h" #include <string> //The attributes of the screen const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; const int SCREEN_BPP = 32; //The surfaces that will be used SDL_Surface *message … | |
Hi I am new to C++ and new to programming in general. I would greatly appreciate if you could help me. I need to create a program using loops, that will do the following 3 task: 1. For each of the three persons, determine and report whether that person was … | |
Hey guys. I need help with these questions please :( 1. Write a function that takes as a parameter a queue of integers and returns a copy of the queue with all the elements stored in reverse order. Use a stack as a helper data structure. [code]queue<int> reverseQueue(queue<int> q) // … | |
I am having a problem writing from a outside file. here is the assignment. Write the program as an object-oriented C++ program that allows the user to select which way they want to calculate a mortgage: by input of the amount of the mortgage, the term of the mortgage, and … | |
I'm having trouble figuring out how I would replace a value in my vector once it is found by the if statement. [code] void ExprTree::setVariable(const string& s, double d) { vector<Variable>::iterator pos; for(pos = varList.begin(); pos!= varList.end(); ++pos) { if(pos->data = s) ; //here is where i'm stuck else if(pos … | |
Hi, I'm not clear as to when memory is allocated from the stack, free store or data area.Can someone please elaborate? | |
Im working in visual studio. In a regular win32 console app i've written a class i want to use in other projects. Basically my question is what is the most efficient way to do this? (I just assumed it would be creating a header file) What kind of project do … | |
I just completed learning C . Now i would like to do something better. Wish to try a new language.The problem is that i cant select which one. Whether Visual C or JAVA or python ...... Also i would like to know the differences between Visual C and C.. Being … | |
I have a txt file which has the following input. 13 .34 67 45 12 4 85 56 42 44 2 8 3 5 2 the first number is the size, second is a multiplier, last one is used for search. I am wondering if the code below looks correct. … | |
I'm making microprocessor oscilloscope and I want to connect in with LPT computer port and I have question. How can I read informations from LPT pins in my program (and writing them) ? (i'm using windows) And in future I want to make my own driver for this project. Have … | |
abc. txt has the following tab delimited values 100 81.7 2000 float tempFloat1; float tempFloat2; float tempFloat3; float tempFloat4; float tempFloat5; ifstream inFile ("abc.txt", ios::in); inFile >> tempFloat1; // debugger - 100 inFile >> tempFloat2; // debugger - 81.699995 WTF1??? inFile >> tempFloat3; // debugger - 100 //old school work … | |
hi Guyz... need some help here... i want to input an integer but it can be either in hexadecimal form or in integer form. the problem is that i would like to store that input in that particular form and separate all hexadecimal values in to an array. for ex: … | |
[code=c++] #include "stdafx.h" #include <time.h> #include <stdlib.h> #include <iomanip> #include <iostream> #include <string> #include <fstream> #include <cmath> #include <stdio.h> #include <cstdlib> #include <sstream> #include <vector> using namespace std; int main(); class Hangman { public: void set_values (string, string, string, string, string, string, string, string, string, string, string, string, string, string); … | |
[code=C++] // //********************************************************************************** //File Name: averages.cc //Description: Calculate the smallest, largest, and the average of the input values. //Date: 10-6-09 //********************************************************************************** #include <iostream> #include <string> using namespace std; int main() { string line; int min=2000000; int max=0; double avg; int next; double sum = 0; double count = 0; cout.setf(ios::fixed); … | |
HI i want to know how to use isalpha in my prog please help me out printf("Enter the ip address using '.' as a seperator after each octet only integers\n"); /* Printing the statement*/ scanf("%d.%d.%d.%d.",&ip[0],&ip[1],&ip[2],&ip[3]); /* Reading the values of ip address and storing integer values*/ printf("Enter the subnetmask address … | |
![]() | I created a map<string, void*>. The void* used to store an Object from a class called Window. I can cout a string with the following: [CODE] it = windowMap.find(title); if( it != windowMap.end() ) { cout << "Value is: " << it->first << '\n'; } else { cout << "Key … ![]() |
Hi, While trying a program from "C++ Primer 3rd Edition" by Stannley Lippman, I encountered with following two errors. 1. The book says that the header file fstream also includes the header iostream, so including just fstream will do. But g++ complained about cout, cin and cerr despite having fstream … | |
[CODE] phonenode *start_ptr = NULL; phonenode *crrnt_ptr; void alpha_order(){ phonenode *ptr, *curr, *temp; ptr = start_ptr; for(bool didSwap = true; didSwap;){ didSwap = false; for(curr = ptr; curr->next != NULL; curr = curr->next){ if (curr->surname > curr->next->surname){ temp = curr; curr = curr->next; curr->next = temp; didSwap = true; } … | |
Well let me start by showing off my source. [code]//This is a game called "The Guessing Game" #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { int number; unsigned seed = time(0); srand(seed); seed = 1 + rand() % 100; cout << "Please try to guess a … | |
D.I.C Head ** Joined: 22 Oct, 2007 Posts: 51 [IN] My Contributions I am little confused here. So please help me. I am given a txt file in the following format 110001 + 123500 ...... I need to read these numbers into the source file, do the addition and then … | |
hi Guyz... need some help here... i want to input an integer but it can be either in hexadecimal form or in integer form. the problem is that i would like to store that input in that particular form and separate all hexadecimal values in to an array. for ex: … | |
Hello, this seems like it will be a helpful community. For my degree I need to take a basic C++ class and the only C++ class the offer that fits is an 8 week class, it [I]really[/I] goes too fast. Anyways, I've been trying my hardest, but my brain really … | |
[code=php] #include <iostream> using namespace std; int main() { int num; const int MAX = 8; int output[8]; cout << "Enter a number [0 - 255]: "; cin >> num; cout << num << "converts to"; for (int i = 0; i < MAX; i++) { output[i] = num % … | |
hi can anyone help me i have a assignment in which i have to do hamming code encoding and decoding using binary in c++ and iam really lost ......can sumone help me pliz...... | |
The following is my class project and I do not have a clue where to begin. Could someone at least point me in the right direction? For this project we are going to work with computing the Fibonacci Sequence (also called Fibonacci Number). We will be using a menu to … | |
[code=cplusplus] #include <iostream.h> #include <conio.h> char *mystrstr(char *,char *); void main(void) { clrscr(); char *str1,*str2; str1 = new char[100]; str2 = new char[100]; cout << "Enter first string: "; cin.get(str1,99); cin.get(); cout << "Enter seconed string: "; cin.get(str2,99); cin.get(); cout << mystrstr(str1,str2); getch(); } char *mystrstr(char *s1,char *s2) { // … |
The End.