51,593 Topics

Member Avatar for
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
120
Member Avatar for atman

Hey guys! I'm trying to calculate the average for student marks using pretest loop, and for some reason i get the wrong result, even though the code looks proper to me., there are 7 questions all of them totaling 100%, i haveto return average mark i HAVETO use pretest loop. …

Member Avatar for Aia
0
145
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
121
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
94
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
148
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
115
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
270
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
93
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
157
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
118
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
111
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
105
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
78
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
886
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
181
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
160
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
88
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 amvx86

Hello all, I've built a program which will take users data from the command line using int main (int argc, char *argv[]). However, when i wrote the program; i can successfully extract the options specified --php --html, etc. What i'm having a hard time with is writing the program to …

Member Avatar for WaltP
0
104
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
172
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
556
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
148
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
149
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
80
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
102
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
99
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
211
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
119
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
117
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
36
Member Avatar for at51178

Hi I am new to C++ programming and as my second personal project I am looking to create a program that will index my PDF,CHM,TXT,and WRD files located on my network drive at home. I would like to replicate window's search feature where you can search for a word or …

Member Avatar for Freaky_Chris
0
69
Member Avatar for Th3_uN1Qu3

Hey again. I'm working on and off on my little tool that currently installs fonts, writes the registry, and will do various other things i'm gonna need. I'm currently trying to implement full error checking before i go on, and i'm pretty clueless on how to use return values. I …

Member Avatar for Th3_uN1Qu3
0
96
Member Avatar for kapil.tandon

hi i added modal popup handler into my application the popup which enmrges out is a panel and inside the panel i added the label and correspondong to label there is one textbox(txtE1) now the problem i m facing is tht i want to write the method related to the …

Member Avatar for kapil.tandon
0
248
Member Avatar for nuubee

Hi guys, Ok, so I'm a bit stuck. I'm creating a program that has 3 classes. An object of one of the classes needs to be made up from 2 objects from one of the other classes.. and I can't figure out how to do it. for example, if I …

Member Avatar for Freaky_Chris
0
109
Member Avatar for ohnomis

Hi everyone, I have a question regarding reading commands from an array for a turtle graphics program. 5, x - Move forward x number of spaces (x being the next number in the array, ie. 5, 5) 4 - Turn right 9 - End commands (sentinel value) If you have …

Member Avatar for vidit_X
0
152
Member Avatar for chetoos

I need help with this code to : a. Creating an array of employees b. Asking the user how many employees records does he want to enter. c. Modifying the input_data function to take the data of all employees and fill them in the array d. Modifying the output_data function …

Member Avatar for Prabakar
0
239
Member Avatar for zaryk

Winapi - I am creating a chat program using the [ICODE]WSAAsyncSelect(Win.Sock, Win.hWnd, WM_USER + 2, FD_READ | FD_WRITE | FD_CLOSE);[/ICODE] and all that good stuff. The client connects to the server and the server sends a message to the client. In response, the client pops up a messagebox stating "connected". …

0
46
Member Avatar for m_arian

Hi I'm new to coding. Can someone please help with a linked list problem. I'm getting numbers for output, I think they are addresses. The output I'm getting is: HEAD CODE -12086434400 1080131584 TAIL CODE The output I need is: HEAD CODE <rect x="0" y="0" width ="200" height="200" stroke-width="2" stroke="red" …

Member Avatar for Prabakar
0
112
Member Avatar for djhello

Write a program that implements an address book for your friends using linked lists. Each person has name, last name, and phone number. Data should be stored in ordered based on last name. The program should include the following menu: 1.Add a friend 2.Delete a friend 3.List all friends with …

Member Avatar for c++ prog
0
101
Member Avatar for haven_u

When i print data stored in a queue it also dequeue these data... can someone provide me hints on how to print data without dequeue...printing should only display data stored in that queue........

Member Avatar for Prabakar
0
93
Member Avatar for freelancelote

Hi, when I try to assign \0 using the expression: pPtr->myArray[127]="\0"; my compiler throws the following error: "invalid conversion from ‘const char*’ to ‘char’. Any idea on what's wrong? Any idea on how to solve the problem?

Member Avatar for Ancient Dragon
0
109
Member Avatar for Liszt

I have a ThirdPart program that appends text to a file randomly. I dont know how this code is doing this, thinking of opening and closing the file. I have simulated that scenario by: //Process 1 Appends Text to File //Process 2 Reads Text From File Now I am writing …

0
69
Member Avatar for cam875

If you have multiple If statements happening to check the logic on something is it better to just use all else if's to make your code execute faster? and I understand that people always say that it is better programming to keep your variables as far from being global as …

Member Avatar for ddanbe
0
164
Member Avatar for DGeneral

Hello, I have been working on this code. What it does basically is read a text file, store the words in a binary search tree, prints out the words in alphabetical order along with line number where the word occur. [B]Example:[/B] Input: I need help with this code Output: code …

Member Avatar for Ancient Dragon
0
183
Member Avatar for JustLearning

I need some help with this binary search tree. I am having a problem printing out the tree. I don't quite understand how to do it. I know that I need to use recursive call to traverse to the end of the tree but the way the header file is …

Member Avatar for Sci@phy
0
180
Member Avatar for Trekker182

I have a project where pretty much all of the variables that I will be working with in spread though my base class and two inherited classes will be prompted for. Up until now, I just passed in the information through parameter constructors in the classes themselves from my application …

Member Avatar for Trekker182
0
91
Member Avatar for Djanvk

Ok so I have make a Windows form in Visual C++, and I know how to use this code to get the text from the text box to a string [CODE]text = txtBox->Text; [/CODE] That is in the Form1.h file, but I have to create some code in my .cpp …

Member Avatar for Lerner
0
88
Member Avatar for DragonReborn225

hey guys, I'm having some difficulty with finding out whether a user inputted string is a palindrome. It doesn't have to identify pure palindromes either, just the basics. Everything was going great, and just as it was looking like I'd get to bed before 3 am, I got hit with …

Member Avatar for vmanes
0
182
Member Avatar for hezfast2

I'm getting an eofbit exception when I run this function. I'm not sure where I've gone wrong with setting this function up. Can anyone tell me what I've done wrong here? I would really appreciate ANY advice. void loadFiles() { ifstream file; file.exceptions ( ifstream::eofbit | ifstream::failbit | ifstream::badbit ); …

Member Avatar for hezfast2
0
98

The End.