49,761 Topics
| |
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) { // … | |
Urbancode today unveiled AnthillPro 3.7, the latest version of its build and deployment automation tool that piles seven popular source code analysis tools onto its [url=http://www.anthillpro.com/html/products/anthillpro/tool-integrations.html]list of third-party integrations[/URL]. There's also support for the GIT repository and DB2 and PostgreSQL databases, the company said today in a statement. Anthill Pro … | |
Hi, I have the following functions [CODE]void LoadData(char* file, float* data1, float* data2) { // read data size and contents from file data1 = new float[dataSize1]; data2 = new float[dataSize2]; // store data data1[0] = 1.0f; data1[1] = 2.0f; // etc ... } void ComputeData() { float *data1 = NULL; … | |
Hello, I've been programming with C++ for only several weeks now, but I have come across a practice problem that has given me trouble. The objectives: collect data from a student including: his major (CIS or Math), last name, number of credits completed, GPA, and tuition paid. Then calculate and … | |
Basically the please hit any key to enter doesn't show up in Visual C++.Thanks for help main //CS 310 /*Create a text file and input in certain data into the text file*/ //Program one #include <iostream> #include <fstream> #include "Account.h" using namespace std; int main() { account b; char name1[256]; … | |
The Question is: Write a program that asks a user to enter one of the following state abbreviations: NC, SC, GA, FL, or AL. The program should then display the name of the state that cooresponds with the abbreviation entered ( North Carolina, South Carolina, Georgia, Florida, or Alabama). Input … |
The End.