51,593 Topics

Member Avatar for
Member Avatar for sweety

[code] // PROGRAM TO FIND THE NEXT DATE OF A GIVEN DATE #include<iostream.h> #include<conio.h> class udate { int day, month, year; public: void read() { cin>>day>>month>>year; } void write() { cout<<day<<"/"<<month<<"/"<<year; } friend int valid(udate); void operator++(); }; int valid(update D) { int d = D.day; int m = D.month; …

Member Avatar for Stack Overflow
0
195
Member Avatar for lost_c++_dude

I know I am missing a big part of this program but for some reason my mind is not working at all tonight. I need to: > Write a program that asks the user to enter the duration of a baseball game > by first asking for the number of …

Member Avatar for jasweb2002
0
141
Member Avatar for JoBe

Hi guys, Quick question, I was trying out to determine the second smallest number of 10 random entered numbers, this is what I got: [code] #include <stdafx.h> #include <iostream> #include <iomanip> using namespace std; int main(void) { int s=0,x=0,y=0; cout<< "Input ten random numbers with cin and determine the second …

Member Avatar for JoBe
0
130
Member Avatar for stevosmyth22

hi all,i have to write a basic c++ program that has to contain all of the following aspects but i am unable to use bank accounts (or any type of account).[COLOR=blue]i am just looking for any general ideas[/COLOR]. the actual functionality of the program can be relatively simple. thanks very …

Member Avatar for alc6379
0
99
Member Avatar for HConn

I am trying to write a program that computes the area of a right triangle. It has to use a function to compute the area. This is actually a part of a bigger program, but when I couldn't get it to work I isolated this section. I tried looking on …

Member Avatar for HConn
0
189
Member Avatar for tonja1196

I am attempting to write a function that determine the area of a triangle. I am not sure what I am doing wrong when trying to determine the area. The error message I am getting is "error-call of overloaded 'sqrt(int)is ambiguous. Can you help me determine what is wrong?? [code] …

Member Avatar for tonja1196
0
101
Member Avatar for see_moonlight

How can i find out a parameter's type? e.g. char no1='a'; which function can i use to find out no1 is char type? fun(no1) reture the no1's type

Member Avatar for Narue
0
85
Member Avatar for NAjAM AHMeD

i need code for sorting number using Declaring and manipulating Arrays. Passing arrays to the functions as parameters. The objective of this assignment is to provide an on hand experience of: o Declaring and manipulating Arrays. o Passing arrays to the functions as parameters. Problem Statement: For this assignment, you …

Member Avatar for jigvesh
0
145
Member Avatar for souphmars

i have sorted data in an array and sent to a file...how do i put this sorted data in a stack.

Member Avatar for souphmars
0
108
Member Avatar for phr0stbyt3
Member Avatar for frrossk
0
101
Member Avatar for hill0ster

I need to get this code to displayEmployeeInfo if the user enters a negative number for ID. Also I can't seem to get a total of all wages to display. Any helpful hints would be greatly appreciated. Thank you! [code] #include <iostream> #include <iomanip> using namespace std; #include <string> int …

0
80
Member Avatar for quasimof

i wrote this program to find prime numbers, but whenever i run it, i get an error. This is the code [c++]: int main(void) { int num=0; int i=0; cout<<"num"; cin>>num; while(i<num) { num=num%i; i++; } if(num==0) cout<<"not prime"; else cout<<"prime"; return 0; } My real task is to get …

Member Avatar for jasweb2002
0
102
Member Avatar for phr0stbyt3

hi... im a bit new to this forum. i saw it on google and decided to join up... im working on a calender like program for my computer science 102 course. the parameters are as follows: Make a program that, when given the mm/dd/yyyy, can decide what DAY the user …

Member Avatar for Narue
0
120
Member Avatar for lost_c++_dude

I keep on getting one error when I compile this. I can't figure out what is wrong with it. Please help. [code] //Write a program that asks the user to enter two integers. //The program should divide the first integer by the second and then display the resulting quotient and …

Member Avatar for vegaseat
0
120
Member Avatar for StanVanDamn

I have a list of 10 numbers in a array and want to sort them. Basically I am using a "quick sort" and want to swap 2 positions in a array. But Im stuck with the code for how to do this. My code is written below. If anyone has …

Member Avatar for Narue
0
141
Member Avatar for Flawless

How can i write an array to file using C++?? i need to write the whole array at once, meaing that the writing function should take a pointer to the array. And the array is holding floating numbers.. What's that fuction name that will satisfy that? How can i do …

Member Avatar for DKnight764
0
5K
Member Avatar for N3wbi3C0d3r

Alright, i just learned the loops (if then else, for, do while, ect.) and just before it i learned the input and output (cin, cout). Now the tutorial i am using, has no homework built in it, so if anyone would be so kind to tell me something, ill probally …

Member Avatar for N3wbi3C0d3r
0
314
Member Avatar for see_moonlight

i just want to find out '?','/','', ect, from a char array, can anyone help me to find out what's wrong with the code below? thanks the reture value is not always what i want? static int is_valid_function_name(char *function_name_string) { for( ; *function_name_string !=' \0 ' ; function_name_string++ ) { …

Member Avatar for see_moonlight
0
156
Member Avatar for Coach_Nate

Hi all... Was wondering if someone could lend a hand - or an eye. I've been trying for hours and was hoping that someone could give me an outside look. I won't beat around the bush, yes this is from a homework assignment, but the assignment is much more than …

Member Avatar for Coach_Nate
0
86
Member Avatar for zenah

:p hi ,this is my first visit to theis web , i hope to help me, i need afull c++ programm of game called "pebble chess" , this game can execute on algorthims called "minmax", and iwill describe this game: 1- each player turn consists of moving one or more …

Member Avatar for alc6379
0
104
Member Avatar for willow

I have tried various break statements and I cannot get my program to break correctly. Original program is a nested loop asking user for input for either an ascending or descending triangle. That works. But when I try to add a break, it either runs after entering how I want …

Member Avatar for vegaseat
0
124
Member Avatar for mahas

#include <fstream.h> class Person { char emp_name[40]; int Tel; public: void ShowData() {cout<<"Name: "<<emp_name<<endl<<"tel: "<<Tel;} }; void main() { Person s1; ifstream file("c:\\mydocuments\\db_add_tel.mdb"); file.read((char*)&s1,sizeof(s1)); s1.ShowData(); } can anyone telme whats really happening aftet opening the add_tel file. actually i don't know how to makethe screen stay because when i run …

Member Avatar for Narue
0
213
Member Avatar for dcving

I fixed the whole program. :twisted: . I compiled it after each step to make sure there were no errors, if so I corrected them. :mrgreen: . I do, however, have 2 questions. :?: . How do I get the highlighted lines [COLOR=Red]below[/COLOR] to center above the [COLOR=Red]****************[/COLOR] :?: And …

Member Avatar for N3wbi3C0d3r
0
197
Member Avatar for ray96

Hi all, does anyone know of a Bitmap Drawing Program (like Windows Paint) that is written in either C, or C++, that I can use as a guide in building my own bitmap program? I have searched all over the internet, but I can't find anything. ANY help would be …

0
79
Member Avatar for Nabeelahmad

When ever i am entering any code it always succeed but i cannot see out put on screen it just flick for few seconds and then come back to complier. for example small prog i am writing #include <iostream.h> main() { cout<<"my name "; return 0: } it should give …

Member Avatar for Nabeelahmad
0
119
Member Avatar for Banu

Hi I am writing a toy encryption method objecy oriented program in which user enters a statement, and each character in the statement is replaced by another character which are stored in a 2D array. I have created a static array in which each alphabet has a value in 2D …

Member Avatar for ZuK
0
943
Member Avatar for hill0ster

Hello, I am getting strange values in my display for the salary, hourly or commission. I do have to use arrays and wondering if there is a simple fix. Maybe I need a pointer to the array? If anyone has a suggestion, please let me know. Thank you. #include <iostream> …

Member Avatar for Chainsaw
0
94
Member Avatar for mahas
Member Avatar for Chainsaw
0
91
Member Avatar for Young Teck 06

Everybody, post your very first C++ code up here if you still have it, heres mines with help from the book I am reading and Narue for the help of keeping the window open, thanks pal. [CODE] // // Program to convert temperature from Celsius degree // units into Fahrenheit …

Member Avatar for Young Teck 06
0
125
Member Avatar for abitlost

Hey guys! I got a bit of a problem and need some help! I wanna solve (as in Ax = B) up to a 6x6 matrix using C (not C++ coz I'm using Linux and vi to code). I'm having HUGE problems with the Gauss reduction and using Cramer's rule …

Member Avatar for Narue
0
113
Member Avatar for N3wbi3C0d3r

I have my Project setup like this. +TW TW1 TW2 Before i created the file TW2 i compiled TW1, and TW1 worked fine. When i added TW2, and then compiled it, and started either TW1 or TW2 it said "Project is not compiled". Any idea on how im sposed to …

Member Avatar for Narue
0
172
Member Avatar for souphmars

i am inputting numbers as characters, then i need to change to their numeric value then add

Member Avatar for Narue
0
130
Member Avatar for dcving

This is what I have so far, I haven't corrected the input prompt display, nor the output display of the time into `HH:MM:SS`. Please give me any suggestions on the program. thanks! :mrgreen: /* Program definition: The program will ask for and read an elapsed time in the following format: …

Member Avatar for Narue
0
138
Member Avatar for smarkles

This is our assignment:An STL List Container that adds at least 5 elementes, display i order, and reverse. That part I've got. I'm still doing research on the write to, store ina file and read from a file. Any help would be appreciated. Thanks Smarkles. #include<iostream> using namespace std; #include<list> …

0
131
Member Avatar for Deiwos

Hi folks, I'm some difficulty getting my program to read in multiple data types off one like of data being input. The way it works is someone enters a name, age, and date of birth, and I then have to process this so that it'll read in these different data …

Member Avatar for Narue
0
94
Member Avatar for mahas

can any1 tellme how to access the sql file using c++. what i've to do is to take a sample file from oracle and one from access(a table having employee's personal info with different attribs,obviously) then i've to print them in c using standard format which i'l define in c++ …

0
69
Member Avatar for the b

ok I am required to write a program that reads text from one file and writes it to another. I can do that easily enough but the second file the text is wrote to is supposed to have no spaces in between the words. how do I do this? here …

Member Avatar for Narue
0
112
Member Avatar for blargage

Hello everyone, im glad i have come across this forum, im sure its going to be a lot of help for me! I have been reading through the forum here to try and find some help with a problem i am currently experiencing. My problem is that i am trying …

Member Avatar for blargage
0
130
Member Avatar for Calum

i'm using Dev C++, and when i write a program, it compiles it fine then when i execute it the program window closes after the program has finished. does anyone know how to keep the window open. im running on XP(SP2). i've tried right clicking on the .exe but theres …

Member Avatar for Calum
0
130
Member Avatar for N3wbi3C0d3r

Posted it in the wrong place, sorry;) Hello peoples, as you can tell by my name, ima newbie coder, and barely know the basic concept of a non object oriented scripting language comonly known as QBasic. I wanna learn advanced programming to make games, and random programs i may need …

Member Avatar for N3wbi3C0d3r
0
145
Member Avatar for bryan7890

i wrote in my prog #include <iostream> using namespace std; int main ( ) { int arraysize = 25; int a [arraysize] = { 2, 3, 5, 19, 4, 20, 35, 123, -3, 45, 82, 93, 62, 35, 29, 21, 19, 57, 35, 64, 62, 324, 242, 0, -3 } …

Member Avatar for bryan7890
0
100
Member Avatar for SyLk

sup guys im trying to implement a nested for loop for a 2 dimension array that initializes the array to the character '*'. but its just printing out garbage, i think im messing up on my syntax :sad:.....some help would be appreciated here is what i got so for: char …

Member Avatar for SyLk
0
149
Member Avatar for mr_mooz

Im trying to write a struct for a binary header of a sun raster file to a file on disk. i have a struct for the header data: [CODE] struct rasterfile { int ras_magic; int ras_width; int ras_height; int ras_depth; int ras_length; int ras_type; int ras_maptype; int ras_maplength; }; which …

0
78
Member Avatar for elianahendler

hi i have a C++ assiggment and have no clue how to do it! the instructions are : write a program that calculates the bill of a simple restaurant. on the menu there are only 3 things to order - orange juice, vegetable salad, pasta. it is possible to order …

Member Avatar for alc6379
0
104
Member Avatar for mahas

can anyone tell me whether i can access databases using c++ i want to access a file one in ms access and one in oracle file. have to make it in standard form using c++(ETL concept) is this possible and how to get connect to the respective data bases. thx …

0
105
Member Avatar for hfick

I am supposed to figure out what the output produced would be from this equation..can anyone help me and explain it to me char var1='s'; char var2='x'; char *ptr1, *ptr2; ptr1=&var2; *ptr2=*ptr1; cout << *ptr1 << " " < var2 << endl;

Member Avatar for Narue
0
164
Member Avatar for Midnight Skulke

I have design two program and both have errors on it. the first is supposed to handle queue on integer, double, string and date. I have done for integer and double. When I compile it there was error on it. If you can just help me debug it and i …

Member Avatar for Narue
0
232
Member Avatar for NAjAM AHMeD

hello! i am a brand new user to this site ihope that my experence with this site would be better than previous ones, i am studying BS(computer science), recently i had trouble with a program that ihave made well that thing is that its is complete and working as well …

Member Avatar for Narue
0
120
Member Avatar for manoj9_5

i am little bit confuse with dynamic polymorphism can any body help me out

0
71
Member Avatar for lvdude

Hi all, First off, I'm relatively new to the world of C/C++. I've taken some courses in University years ago and haven't used it much since. What brings me back is the following dilema I have: I've built an application using National Instruments LabVIEW ([url]www.ni.com[/url]). For those not familiar its …

Member Avatar for lvdude
0
206

The End.