49,761 Topics
| |
Hi if i want to say if (int <= 0 || int is not a number) how could i do this i want to make sure that a positive number is input not a negative number or word or symbol hope this makes sense | |
Well, I need to write a program that uses enumerated datatypes, structs, and plenty of functions. Below is my current code: [CODE]#include <iostream> #include <fstream> #include <iomanip> #include <string> using namespace std; void getInput(string input); void outputStudent(string student); void outputTeacher(string teacher); void outputStaff(string staff); void sendtoOutputStudents(string students); struct personDataType { … | |
Hi All, Having already developed fixed-type binary tree classes in the past, I am reasonably familiar with the process of serialization and the graph topology of tree structures in general. However, I am currently attempting to implement a generalized C++ tree template and have absolutely no idea as to which … | |
how would i write a code that will take the values of one array and copy it to another? ex: array1 and array2 have 100 elements so would it be: [code] array1 [100] = array2 [100] [/code] or does that just pass a reference? | |
write a program which fills a 10 element array using a for loop with numbers 90,80,70 etc. write a function to return the maxi value of the numbers in the array. write a function to return the average value of the numbers in the array. | |
I'm interested in writing a memory scanning program (for cheating in games, looking for hidden processes, and such). I'm wondering if there's any way to do this with C++ without extensive knowledge of windows classes/programming. I'm thinking assigning a pointer to the first location of the processes stack or something, … | |
I don't understand what I am doing wrong: I'm developing a program for a school project and it's just not working. I need to get a player's age, and a player's nine scores (which I have), then I have to find what age group they are in (which I know), … | |
I am trying to implement a airline check-in line. I have three types of customers-generic, frequent flyers, and elite. Elite further breaks down down into gold, silver and bronze. The ranking follows that generic and frequent flyers are the lowest priority of customers. The check-in clerks can wait on these … | |
What does == test when applied to arrays in C++? Does it test for type equivalence or equal memory locations? | |
I'm quite a novice when it comes to C++, and am part of the way through working out a program to identify the first 7 Mersenne Primes. I'm sure I have quite a few syntax errors as well as logic errors but I'm banging my head against the wall when … | |
hello everyone. i have search through the forums but unfortunately couldnt find the solution. if this topic has been discussed before, do give me the links to that thread. i work as intern now and my employer asked me to program a software using c++ but they want it with … | |
Our task is to write a Binary Search Tree and the data has to be input from a .txt file where in the data is held as such [CODE]12345678[/CODE] Each digit is a new node in the tree to be inserted. My Binary Tree is working because I can just … | |
Im having trouble turning this function into a recursion function, partly because I did it another way and now I cant think of how to do it recursively. Can you help? [CODE]int list::recursion(int item, int position) { node* temp = startPtr; while(temp != NULL) { if(temp->item == item) return position; … | |
Any think they could attempt this, or give some pointers on it: write a simple hash function using modulo division as the hash methods. | |
I've tried hard to solve this but I still couldn't make it right. Here's what I've made. #include <graphics.h> #include <ctype.h> #include <math.h> #include <conio.h> #include <stdio.h> #include <process.h> int check(int,char); void Initialize(void);void drawEllipse1(int color); void drawEllipse1(int color); void drawEllipse2(int color); void main() { int color, color1; char ch; Initialize(); … | |
I'm not sure what to do exactly. I get some errors that say that displayBoard is declared as an integer yet, I have it declared as void. I'm not sure where these are coming from and they are impeding me from continuing with my work. I would appreciate any pointers … | |
Well, this post might seem weird but as i am very much confused, i thought to seek some help from here. My question is : When should i call a base class implementation of a message handler in my own implementation? ( I am talking about MFC.) For example : … | |
Hey Everyone, Currently, I am working on a base converter that converts a binary to decimal or decimal to binary or binary to hex. However, for this I need to read the string or the number from the text file and convert it to a hex or binary or octal. … | |
i want to convert an ansi string using toascii() function if any one has got a code please help | |
Hi again guys, Im trying to declare SIZE as a constant but i keep getting an error saying C++ forbids declaration of SIZE with no type. Does anybody know how to fix this. it was also giving me an error when i was using the void main command so i … | |
[code] int array1[4], array2[4] = {3, 6, 9, 12}; array1 = array2; [/code] and this one: [code] void showValues (int nums [4][]) { for (rows = 0; rows < 4; rows++) for (cols = 0; cols < 5; cols++) // is this the line of error? cols is not declared … | |
Given the following function variables declarations in C++: int (*f)(int); int (*g)(int); int (*h)(char); when try to assign f=g its fine but trying to do h=g gives an error with a C++ compiler, can anyone tell me why this is? | |
For some weird odd reason, sqrt(2/num) does not work. [ICODE] cout << " sqrt(2): " << sqrt(2) << endl; cout << " sqrt(num): " << sqrt(num) << endl; cout << " sqrt(2)/sqrt(num): " << sqrt(2)/sqrt(num) << endl; cout << " sqrt(2/num): " << sqrt(2/num) << endl;[/ICODE] results in [ICODE] sqrt(2): … | |
When I compiler my program I get this warning and when running it a runtime error. The warning is: 128 ... [Warning] passing arg 1 of `MostraPantalla' makes pointer from integer without a cast | |
[code=cplusplus] #include <cstdlib> #include <iostream> #include "stdafx.h" using namespace std; int main() { char YorN; cout << "This Program Calculates Job Earnings\n\n"; cout << "Would You Like To Use The Pay Calculator Program: "; //With while loop the 2 previous cout statements are not //read cin >> YorN; while ( … | |
I have to use stacks for my program, but I've never done them before so I looked up a code in my book to try and help me understand it but parts are confusing me. [code] void push(char item) { if (full()) throw FullStack(); else { NodeType* location; location = … | |
Hi, I am trying to parse a txt file in C++. I usually use perl to parse thru text files but need to do it in c++. Here is my text file. [code] NAME BITMAPVBIREFE MESSAGE VirginBitMapiIrefE VCCVALUE 3.000000 VIHSELECT 1 VIHVALUE 3.000000 WPSELECT 1 WPARGSELECT 0 WPVALUE 2.600000 [/code] … | |
[code] //***************************************************************************** // CPSC1620 - Fall 2008 // // // Date: // Purpose: Program to perform array operations using functions //***************************************************************************** #include <iostream> using namespace std; //Prototype int readSeq(int []); int main() { return 0; } //***************************************************************************** //Function: readSeq //Assumption: Reads a sequence of integers //Action: Stores the sequence in … | |
i want to add a selection sort to this code by the id_number and i have the selection code but i cant implement it to my code [code]#include <iostream> #include <string> using namespace std; struct database { int id_number, age; float salary; string name; }; void input_data(struct database*data_ptr) { int … | |
When I try and compile any code in VS 6.0 it doesn't work. When I build the exe, linking just doesn't happen. [code]--------------------Configuration: TEST - Win32 Debug-------------------- Linking... [/code] is all I get, I've let it sit for hours. What's going on? Using WinXP SP2 |
The End.