49,766 Topics

Member Avatar for
Member Avatar for jakesee

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 …

0
82
Member Avatar for infern0

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

Member Avatar for Grn Xtrm
-2
110
Member Avatar for quintoncoert

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 …

Member Avatar for Basicgear
0
582
Member Avatar for Basicgear

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 …

0
66
Member Avatar for Basicgear

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 …

0
65
Member Avatar for grijalva10

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 …

Member Avatar for chunalt787
1
111
Member Avatar for scantraXx-

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

Member Avatar for chunalt787
0
142
Member Avatar for hollywoood69

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 …

Member Avatar for Kashaku
0
198
Member Avatar for railmaster7

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 …

Member Avatar for chunalt787
0
142
Member Avatar for AutoC

Hi, I'm not clear as to when memory is allocated from the stack, free store or data area.Can someone please elaborate?

Member Avatar for chunalt787
0
102
Member Avatar for brando|away

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 …

Member Avatar for Dave Sinkula
0
141
Member Avatar for alvalany

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 …

Member Avatar for inspiron630
0
109
Member Avatar for NICEGUY123

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

Member Avatar for Sky Diploma
-4
111
Member Avatar for oneat

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 …

Member Avatar for Ancient Dragon
0
82
Member Avatar for plcross44

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 …

Member Avatar for Ancient Dragon
0
84
Member Avatar for ayan2587

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

Member Avatar for ayan2587
0
330
Member Avatar for ramsdellcp

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

Member Avatar for ramsdellcp
-1
138
Member Avatar for DC257209

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

Member Avatar for mrnutty
0
145
Member Avatar for maddy1985

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 …

Member Avatar for mrnutty
-1
99
Member Avatar for Oritm

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 …

Member Avatar for Oritm
0
65
Member Avatar for mrinal.s2008

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 …

Member Avatar for William Hemsworth
1
320
Member Avatar for hur1214

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

Member Avatar for dkalita
0
92
Member Avatar for Kl2eativ

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 …

Member Avatar for siddhant3s
1
107
Member Avatar for robgeek

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 …

Member Avatar for rbv
0
106
Member Avatar for ayan2587

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

Member Avatar for John A
0
161
Member Avatar for that_fox

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 …

Member Avatar for chunalt787
0
166
Member Avatar for kn336a

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

Member Avatar for kn336a
1
107
Member Avatar for rinalini

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

Member Avatar for mrnutty
0
39
Member Avatar for ccoleman52932

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 …

Member Avatar for ccoleman52932
0
88
Member Avatar for Mahyar

[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) { // …

Member Avatar for sarayaj
0
203

The End.