48,985 Topics

Member Avatar for
Member Avatar for Starz20

Hi, everyone. You may have probably heard this a hundred times, but I am new to programming and I am taking an intro to C++ class. I have a program that I have written, but I can't understand why it will not exit gracefully. This is what I have written, …

Member Avatar for Starz20
0
161
Member Avatar for some one

please where is the error in this code doesn't run [code] #include<iostream> #include<cstdlib> using namespace std; int main() { int ages[1000]; int size=1000; int i,a,b; for( i=0;i<size;i++) { ages[i]=rand(); for( a=1;a<size;a++) { for( b=size-1;b>=a;b--) { if(ages[b-1]<ages[b]) { i=ages[b-1]; ages[b-1]=ages[i]; ages[b]=i; } } } } cout<<ages[i]; return 0; } [/code] Code …

Member Avatar for some one
0
112
Member Avatar for Acidburn

Hello, as you well know I've got a hangman game produced, I now have the luxury of adding to the code since all my work is completed ...yay, well, I've decieded to take it a step further and draw out the hunged man! I have the drawing , its just …

Member Avatar for Acidburn
0
2K
Member Avatar for hopeolicious

how do I get my calculations like ex. I want to add up the average gallons used per mile for a car if the car went like 1450 miles and used 62 gallons of gas I dont want it to be a whole number i want it to be like …

Member Avatar for Dave Sinkula
0
176
Member Avatar for acidburns

:evil: The following C program is mainly written to work as an address book. I have written the code but the VC++ compiler shows four errors and I cant find them :rolleyes: . Can some one please help me find them..my assignment deadline line is on the 10th of this …

Member Avatar for acidburns
0
176
Member Avatar for mel2005

[U][B]i only want what you think, the anser is, this came in a exam paper last year, am not sure what the answer is, can anyone help and explane what hes after please[/B]Using access and visual basic or c++ or pascal[/U] i've been told something like this will come again, …

Member Avatar for mel2005
0
88
Member Avatar for msaqib

Hello here is a site that contains lot of tutorials for C/C++ programming. Hopefully u will find them useful and also u can download the source code. [url]http://www.mycplus.com/[/url]

Member Avatar for JoBe
0
105
Member Avatar for tyczj

so im trying to write this program that converts Fahrenheit to Celsius and vice versa but im gettin an infinate loop at the menu. i go to select the number that i want and it just displays the menu again, i though i was doin it right? [code]#include <iostream> //for …

Member Avatar for tyczj
0
113
Member Avatar for mel2005

i know this is a vb assignment, but my tutor want me to do it in vb or c++ with access, i need to create tables with access, i can see two tables but am sure there another one, i know css is a table and pencil is also a …

Member Avatar for alc6379
0
129
Member Avatar for itebook

[I]Link removed due to illegal content. If you feel this change was made in error, PM me with proof of legality. -Narue[/I] This site contains 1700+ ebooks on php, Java, access, .NET, c#, UML, Perl, c++, linux, sql server, asp.net, Oracle, db2, xml, javascript, unix, flash, cisco, excel.

0
85
Member Avatar for meabed

This is a short list of recommendations on how to use C++. My experiences are from using gcc 2.8.0 and Visual C++ 6.0. I had to have things compatible between these two compilers, and between Unix and Windows. [b]Contents[/b] [color=#800080]IO of binary files[/color] [color=#800080]When are destructors called for local variables[/color] …

0
135
Member Avatar for lulug76

I am trying to make the random generator fill my array with no duplicates. An diplay the in order but aslo first line to print array[0], then second line array[0] and array[1], so on and so on until it display all twenty on one line. Pease help [code] #include <iostream.h> …

Member Avatar for lulug76
0
166
Member Avatar for bobr_1013

Hi, Ran into another issue with my program. In C or C++ is there an easy way to skip the linefead at the end of a record (hex 0a)? Thanks,

Member Avatar for bobr_1013
0
184
Member Avatar for AaronYoq

I'm trying to get the computer to compare a username and password entered by the user to a username and password in a text file. If a match is found, then I am going to present the user with other options. I think there must be an easier way to …

0
122
Member Avatar for peterb92

hello experts!!! im just a beginer.. thats wants to know alot.. i want to program my own tictactoe game.. but i dont have visual basic..can anybody plz.. give me some codes that i can edit my self with javascript or html.. if possible? can you make a tictactoe game with …

Member Avatar for Narue
0
109
Member Avatar for k0ld

Here is the code: [code] #include <iostream> #include <cstdlib> using namespace std; class student { public: void inputScores(); // Prompts user to enter 2 quiz, a mid term, and a final score; store // them in corresponding data members. void computeGrade(); // Compute average and then convert the average to …

Member Avatar for k0ld
0
191
Member Avatar for missy

i need help to rewrite this in infix to postfix using class. it was in a struct format at first, now i need to format this in a class version. [code] #include <iostream> #include <cstring> using namespace std; const int SIZE = 20; private: int top; char num [SIZE]; public: …

Member Avatar for Narue
0
162
Member Avatar for gracieLou

How do you convert a string to an int? In my book under string functions, it shows this short example: [CODE]ia = atoi ("-123.45xyz"); [/CODE] which says that ia = 123. So, I tried applying this to my code. [CODE] index = atoi (a.GetCode()); cout<<description[index]; //a.GetCode() returns a number string …

Member Avatar for marinme
0
91
Member Avatar for cblue

Can anyone give me an idea how to convert an int or decimal number into hexadecimal? I know how to do it for binary by dividing by 2 and using the modulus % operator, but how do you take into account a b c d e f if the integer …

Member Avatar for Narue
0
139
Member Avatar for bobr_1013

The problem I'm having is this: I have a table [MAX_ELEMENTS] [18] where the MAX elements can be as high as 100,000. The length of each element is 18 characters. What I doing is simply loading in full 18 character records into this table. The problem I'm having is that …

Member Avatar for bobr_1013
0
151
Member Avatar for mdbrock7

I am in a beginner C++ class and I have a homework problem where I must to find the greatest common divisor through subtraction. I am totally lost. Can anyone show me what I am doing wrong? #include <iostream> using namespace std; int main () { int m; int n; …

Member Avatar for Narue
0
271
Member Avatar for dallin

when using #include <iomanip> ; what is the syntax for formating numerical values for currency - example 123456, format to $123,456. Using the cout << command.

Member Avatar for dallin
0
167
Member Avatar for Acidburn

Got bored, and whats better than spending your time learning. So I'd thought I'd create something fun, [code] #include <iostream> using namespace std; int main() { char array[5] = "John"; //chosen hangman char array2[5]; //populates with * char key; //ets a key from the user int life = 5; int …

Member Avatar for Narue
0
202
Member Avatar for xsxixtxhx

I have this program that is supposed to take in numbers from the Main cpp file and add them to the link list. Eventually i have to sort them then display them on the screen. For right now i am just trying to insert them to the link list but …

Member Avatar for Narue
0
147
Member Avatar for shock1

Write the definition of a function printAttitude , which has an int parameter and returns nothing. The function prints a message to standard output depending on the value of its parameter . If the parameter equals 1, the function prints disagree . If the parameter equals 2, the function prints …

Member Avatar for Narue
0
383
Member Avatar for shock1

Write the definition of a function printLarger , which has two int parameters and returns nothing. The function prints the larger value of the two parameters to standard output on a single line by itself. this is what i have so far: void printLarger(int, int){ } I have to write …

Member Avatar for Narue
0
192
Member Avatar for Acidburn

hello, I kep getting : [quote] C:\computer science programming\excerise sheet 6\cheque account\3 - Bank.cpp(100) : error C2614: 'cheque' : illegal member initialization: 'Balance' is not a base or member Error executing cl.exe.[/quote] [php] #include <iostream> using namespace std; class BankAccount { public: //void setAccount(int num, double amount); taken out replaced …

Member Avatar for Acidburn
0
137
Member Avatar for The_Diceman

Help me if you can please ??? Got so far on my project and know gone brain dead!! Project is for company called Zenith Paints ( please someone reconise this) (The first program in the Visual C++ project is a validation program. You are required to validate three different types …

Member Avatar for The_Diceman
0
182
Member Avatar for missy

how do u rewrite the infix to postfix conversion using class. i have my code from struct stack type. [code]#include <iostream> #include <cstring> using namespace std; const int SIZE = 20; private: int top; char num [SIZE]; public: void stack_init (stack_type&); void push (stack_type& , char); void pop (stack_type&, char& …

0
75
Member Avatar for rharvison

This is my very first introduction to C++ and I am stuck with a very simple mini-calculator project. I cannot figure out what the errors are that the compiler is showing. I have shown my written code and the compiler messages below that. I am receiving syntax errors on the …

Member Avatar for rharvison
0
112

The End.