49,761 Topics

Member Avatar for
Member Avatar for afromong

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

Member Avatar for afromong
0
82
Member Avatar for PaladinHammer

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

Member Avatar for mrboolf
0
118
Member Avatar for LincolnGurl

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 …

Member Avatar for LincolnGurl
0
118
Member Avatar for afg_91320

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?

Member Avatar for skatamatic
0
2K
Member Avatar for BRICEK

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.

Member Avatar for freudian_slip
0
91
Member Avatar for skatamatic

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

Member Avatar for zhouxuzhu1985
0
145
Member Avatar for hwlibra083

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

Member Avatar for mrboolf
0
113
Member Avatar for DLightman

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 …

Member Avatar for skatamatic
0
260
Member Avatar for vladdy191

What does == test when applied to arrays in C++? Does it test for type equivalence or equal memory locations?

Member Avatar for skatamatic
0
89
Member Avatar for comrad3

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 …

Member Avatar for ddanbe
0
153
Member Avatar for songkok

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 …

Member Avatar for songkok
0
112
Member Avatar for chunalt787

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 …

Member Avatar for chunalt787
0
109
Member Avatar for JackDurden

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

Member Avatar for skatamatic
0
103
Member Avatar for flexy82rpq

Any think they could attempt this, or give some pointers on it: write a simple hash function using modulo division as the hash methods.

Member Avatar for skatamatic
0
76
Member Avatar for Asen

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

Member Avatar for Freaky_Chris
0
878
Member Avatar for kotkata

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 …

Member Avatar for ArkM
0
178
Member Avatar for Bhoot

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

Member Avatar for Bhoot
0
155
Member Avatar for k88joshi

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

Member Avatar for ArkM
0
86
Member Avatar for aksshe10

i want to convert an ansi string using toascii() function if any one has got a code please help

Member Avatar for ddanbe
0
60
Member Avatar for andrewama

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 …

Member Avatar for grumpier
0
162
Member Avatar for afg_91320

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

Member Avatar for Alex Edwards
0
552
Member Avatar for vladdy191

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?

Member Avatar for skatamatic
0
143
Member Avatar for freudian_slip

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

Member Avatar for vmanes
0
147
Member Avatar for Srynx

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

Member Avatar for bonnie1702
0
76
Member Avatar for college.student

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

Member Avatar for vmanes
0
99
Member Avatar for DemonGal711

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

Member Avatar for DemonGal711
0
96
Member Avatar for Niner710

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

Member Avatar for Lerner
0
207
Member Avatar for koman

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

Member Avatar for freudian_slip
0
115
Member Avatar for chetoos

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 …

Member Avatar for ArkM
0
114
Member Avatar for riscphree

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

Member Avatar for Ancient Dragon
0
34

The End.