51,593 Topics

Member Avatar for
Member Avatar for blamp

can someone help me figure out why the output of my program is coming out wrong [code] #include<iostream> using namespace std; class fractions { public: fractions fractions :: operator+(fractions f); fractions fractions :: operator-(fractions f); fractions fractions :: operator*(fractions f); fractions fractions :: operator/(fractions f); fractions addFraction(fractions); fractions subFraction(fractions); fractions …

Member Avatar for jonsca
0
106
Member Avatar for uberian22

this is my function [CODE]double area (int side_a, int side_b, int side_c) { double semi; double area_ans; semi = semi_peri (side_a, side_b, side_c); [COLOR="Red"]area_ans = (sqrt(semi * (semi - side_a)(semi - side_b) (semi- side_c)));[/COLOR] return area_ans; } double semi_peri (int side_a, int side_b, int side_c) { double semi_ans; semi_ans = …

Member Avatar for uberian22
0
82
Member Avatar for Chromatic

Hi, I've been trying to get Conway's Game of Life code to work now for the past two days with no avail! The rules of the game are: Any live cell with fewer than two live neighbours dies, as if caused by underpopulation. Any live cell with more than three …

0
65
Member Avatar for pac-man

As the title says please. The issue I'm having is I've got a class which holds the vector. When I create a new instance of the class I assume a new vector is also created which results in the vector losing all its contents?

Member Avatar for pac-man
0
167
Member Avatar for balajiam

Howdy, I am creating a GUI in QT 4.5.3. I am having a problem trying to create a new subclass of QWidget. I already have several (3) other subclasses of QWidget, but when I attempt to add an additional one, the code does not compile. Here is the newClass: [CODE] …

0
59
Member Avatar for evilsithgirl

Hello. Here is my homework problem: I have a set of numbers for which i have the inorder and preorder traversal. I need to construct a binary tree from those. I have most of the code written i just need some help with a specific part. I have heavily commented …

0
55
Member Avatar for Gem74

Hi, I am trying to build a linked list, I have the following, and I get 4 error messages, ListNode, NumberList, and head undeclared, and then syntax error, please help. #include <iostream> #include <fstream> #include <ctime> #include <string> #include <cstdlib> //#include "input_data.h" using namespace std; class Node { public: int …

Member Avatar for jonsca
0
151
Member Avatar for Calhoun

Could someone show me how to compile this [URL="http://sourceforge.net/projects/torrentsearcher/files/"]source code[/URL]? I dont know much about C++ but I want to edit the file that contains the homepage so the homepage is google. [url]http://sourceforge.net/projects/torrentsearcher/files/[/url] I think the program contains 3 different peoples source code that work together in the actual torrent …

Member Avatar for Grn Xtrm
0
82
Member Avatar for guffer

i have a program which displays a certain menu, after the menu it askes for the selection from the menu....now when an integer is used it works perfectly. but when you input a character(letter) in the menu it goes into an infinite loop. anything to use to stop this behavior …

Member Avatar for Jiwe
0
137
Member Avatar for abdelhakeem

Hello ! I'm New to ASP.NET, I want to use it with C++. I installed Microsoft Visual C++ 2008 Express Edition, And installed IIS ,When i've Written my First code to Test, I got this message: [QUOTE]An unhandled exception was generated during the execution of the current web request. Information …

Member Avatar for jbennet
0
218
Member Avatar for sonygamer

Hello everyone, I'm currently having some problems with this code. I am getting many compiling errors and i was wondering if you guys could help get rid of them. [CODE]#pragma once #define CAPACITY 128; typedef int QueueElement; class Queue { public: Queue(); int empty(); void enqueue(const QueueElement & value); void …

Member Avatar for sonygamer
0
179
Member Avatar for guccitan88

Hi! I'm really new to C++ and posting to forums so please excuse any mistakes I may make. I have to write a program that simulates throwing 2 die and printing their sum 25 times, seven sums per line. I'm stuck on the "seven sums per line." Do I need …

Member Avatar for guccitan88
1
2K
Member Avatar for StaticX

Hi, I have made a small program to check if character arrays are the same(similar to string compare).This is my code so far: [CODE] // string Compare () #include <iostream> using namespace std; main(){ char a[10] = {'a','b','c','d','e','f','g','h','i','j'}; char b[10] = {'a','b','c','d','e','f','g','h','i','j'}; for(int i = 0; i < 10; i++) …

Member Avatar for Dave Sinkula
0
111
Member Avatar for nick1188

i hav installed Turbo C++ 3.0 on my pc and whenever i dbl click on TC.exe the screen turns black and after 2-3 secs the screen becomes normal i mean the compiler doesnt start same happens with borland 5.5 C++ builder pls help me as i hav no s/w on …

Member Avatar for alg
0
116
Member Avatar for BobClark

In the 80's there was a Japanese floppy format that put 1.2M on a 3.5 floppy. I believe it had 77 tracks, 8 sectors and 1024 bytes per sector. Not to mention it used a tri-mode drive which is still available today but must be used with a PC bios …

0
39
Member Avatar for Aamit

[code=c] #include <stdio.h> #include <conio.h> int main(void) { unsigned port = 0; int value; value = outp(port, 'C'); printf("Value %c sent to port number %d\n", value, port); return 0; } [/code] It gives error 8 C:\Dev-Cpp\Abc\... `outp' undeclared (first use this function) How to solve this ?? I write function …

Member Avatar for BobClark
0
593
Member Avatar for samsons17

how do i display something like this using for loop? 0 2 4 6 8 10 12 14 18 24 26 28 30 32 thank you for helping...

Member Avatar for Skeen
0
313
Member Avatar for asexe

I'm trying to write a simple "MSPaintish" program, but I can't handle this one issue. [CODE]case WM_LBUTTONDOWN:{ button = true; //save the start cords and invoke WM_MOUSEMOVE x1=LOWORD(lParam); y1=HIWORD(lParam); SendMessage(hwnd, WM_MOUSEMOVE, wParam, lParam); break; } case WM_LBUTTONUP:{ button=false; break; } case WM_MOUSEMOVE:{ if(button){ HDC hdc=GetDC(hwnd); HDC hdcmem = CreateCompatibleDC(hdc); HBITMAP …

Member Avatar for William Hemsworth
0
481
Member Avatar for kingstrider

hey guys can anyone plz xplain to me how can v make a hexagon using only for loops?i just cant figure out how to do it :(

Member Avatar for Clinton Portis
-2
88
Member Avatar for maverick405

I am trying to get user input for any ten numbers and then to print them in reverse order below is my code it executes and gives me result but I am not able to get user input... please help me.. #include<iostream> int*ReverseArray(int*orig,unsigned short int b) { unsigned short int …

Member Avatar for tkud
0
110
Member Avatar for IT seeker

salam, hope u people ll fine , any body have solved excercises of CHAP 2, CHAP 3,CHAP4 AND CHAP 5 BY D.S AMLIK book i need these urgent so kindly help me my exams r very near n i w ant to prepare them

Member Avatar for ithelp
-5
221
Member Avatar for jascase901

So far, I have only read about using void functions to take on ifstreams as a parameter. Yet I want to be able to make a single function that takes a file of numbers as a parameter, and do some calculation to each number. I can do this with a …

Member Avatar for alg
0
147
Member Avatar for debasishgang7

Hi all I want to make an Instant Messenger Client(like gtalk)with c++. any one know something pls. help me out. if you know any available web resources pls. let me know about that .... I need only the code.I dont want the GUI prog.. pls.. pls..

0
103
Member Avatar for dylank

Hi, I have a program that I am using to convert a string into binary. My current code is as follows: [CODE]int main(void) { string userInput; cout << "Enter a string to be converted:" << endl; cin >> userInput; for (int index = 0; index <= userInput.length(); index++) { cout …

Member Avatar for dylank
0
162
Member Avatar for ninreznorgirl2

I've worked with making classes, but I've never had to use a class in code that I write, so I'm having a hard time. [CODE]#include <iostream> #include <string.h> #include <iomanip> #include <ctype.h> #include "String2.cpp" using namespace std; const int MAX_WORD_LENGTH = 254; // The type definition below permits much easier …

Member Avatar for u8sand
0
209
Member Avatar for PDB1982

I have to make a program that uses Periodic Payments and Unpaid Balance (When Payments are made). I am having trouble with the mathematics with my code (I know this isn't a math forum, but I think it's more of a coding issue). The formulas, and output are below.....do you …

0
62
Member Avatar for squigworm

Hello, I am having trouble with one of my assignments and was hoping someone could help explain why this problem is occurring. The following code is set up to ask the user if they would like another transaction after they have completed the program. The first time the user inputs …

Member Avatar for squigworm
0
148
Member Avatar for juniper2009

Dear All I would be very happy if you could help me! I need to create a main() program which is be able to; * reads in a list of words and their associated meanings from the given test file(file.txt)(This file contains 10 lines) * provide an interactive menu interface …

Member Avatar for juniper2009
0
804
Member Avatar for devo_99

Hello, I am new to this C++ stuff and I am in need of assistance with this code for counting vowels. I missed a few days of class and am some what lost. I keep getting the error codes: C2228 saying it must have class/struct/union and C2109 requires array or …

Member Avatar for K0ns3rv
0
142
Member Avatar for IT seeker
Member Avatar for Ancient Dragon
0
116
Member Avatar for soccergad

This code when compiled ...saids it contains infinite loop but i don't how to fix it? can someone tell me what im doing wrong? ~thank you [CODE] #include <iostream> #include <string> using namespace std; // this program asks the user to order an ice cream int main() { string flavor …

Member Avatar for AAAKsu
0
100
Member Avatar for hakan5

Good day. Here's my code. My uncle helped me with it for days but he's now out of the country for 2 weeks. I'm looking for help to improve this project of mine with mutex and semaphores. I've never used them before and I'm a little confused. I'm running this …

0
55
Member Avatar for sfrider0

Hey. I'm trying to simply input items into a list, then be able to sort them and do whatever. I've done this before for my previous classes, but we have we have to use class files out of the book and modify them to make this work and I'm having …

Member Avatar for HAZEM8002
0
152
Member Avatar for johnyjj2

Hello :-)! There is a problem with building project in NetBeans. I've got two directories sphinx4-1.0beta3-src and sphinx4-1.0beta3-bin, which are part of speech recognition system CMU Sphinx, Sphinx4 is written in Java. In the directory S:\tutorial\sphinx4-1.0beta3-bin\bin I've got some .jar files, e.g. HelloDigits.jar. In S:\tutorial\sphinx4-1.0beta3-src there is no bin directory, …

0
373
Member Avatar for Carrots

Hi, I have a question. Using the following code: [code=c++] #include <iostream> int main() { std::string s1; std::cout << s1.capacity() << std::endl; system ("PAUSE"); return 0; } [/code] In Ubuntu/KDevelop the output is 0. In Windows/V.Studio the output is 15. Can anyone suggest why it happens? I'm somewhat stumped by …

Member Avatar for Narue
0
178
Member Avatar for pac-man

Hi guys, I was hoping someone could explain to me how I would go about grabbing a pointer/reference to my variable 'textName' contained within the Reports class, (some code omitted to try to simplify the scenario) [CODE] //Reports.h class Reports : public wxPanel { public: void AddStudent(wxCommandEvent & event); wxTextCtrl …

Member Avatar for pac-man
0
98
Member Avatar for lucky_43

Hello.. Ive written this code which dont work, its jobis simply recieving names from the user in a structure [a] and delete a name that chosen by user, the compiler give me error flag in the line noticed bellow:) [CODE]#include <iostream.h> #include <conio.h> struct m{ char n[15]; }; void main() …

Member Avatar for Clinton Portis
0
133
Member Avatar for rupertbeard

Is it possible to have software lock itself till the user completes a form on a web page? The user installs the software, then a splash screen pops up and their web browser opens to a predefined page. The page is a form that needs completing. Say the form is …

Member Avatar for kolosick.m188
0
101
Member Avatar for micromic

Hi, I need to produce an xy matrix on screen of tiny boxes, each equivalent to 2.5 x 2.5 mm. I want to group them into sixes. When the mouse pointer is moved across the tiny boxes in any six group I want the program to register when the mouse …

Member Avatar for Clinton Portis
0
93
Member Avatar for aagajaba

The following code works, it prints hello world. Also, depending on the second value, it either gives segmentation fault or doesn't gives segmentation fault. Can someone please explain me what is happening internally. [CODE] int main = ( cout << "Hello world!\n", 195 ); [/CODE]

Member Avatar for Clinton Portis
0
118
Member Avatar for arshad115

hi,i am making trees and i want to draw the structure of the tree in windows forms applications.since the class tree has the access to the trees root pointer.so only a member function of the class can draw the nodes of that tree. but i cannot use the graphics pointer …

0
154
Member Avatar for lexsoOr

I was having problems with this program or better with the int main() function. The program is supposed to ask the user for his name and password. After that the user will be able to access different infos based on his security clearing. The comments in the code are English …

Member Avatar for lexsoOr
0
89
Member Avatar for vikasbe

hello, i m using c# and vb both in my web project. it gives error when connectin c# page with database. it is not taking any label taken in c# page. can anyone help me.

Member Avatar for kvprajapati
0
35
Member Avatar for spankboy11

Hi there, I'm assuming the answer to this problem is really easy, but I just can't work out where the problem is. It's driving me insane and I'd really appreciate some help. I'm new to C++. My problem is this: I'm trying to pass a char array to a function, …

Member Avatar for spankboy11
0
165
Member Avatar for karanmehra18

hi..i am writng a program.....i have collected a lot of information(name,hobbies etc.....) of about a hundred students in my school.......i have also stored their photographs in .jpeg format.........i am using Dev c++ and windows xp..........i want to store all this info + photos in a single file....how do i go …

Member Avatar for thines01
0
120
Member Avatar for johnray31

hello guys here is a problem when i was written a simple demonstrative linklist program i got the[B] general protection error[/B] ([B]**one more question i need ur guide i have the turbo c++ compiler but this does not support when i write #include <iostream> using namespace std; plz tell me …

Member Avatar for vibhu1
0
234
Member Avatar for icu222much

I have created a linked list in Java, and now I am trying to convert my program to C++. When I try to compile, it gives me the error saying that 'next' uses 'CarNode' which is being defined. I am wondering if there is any way around this? Java: [CODE]public …

Member Avatar for VernonDozier
0
194
Member Avatar for simonsayz27

Hey everyone. I first post and I couldn't figure out how to encase my code, sorry. Let me know and I'll do it next post. Anyways, I've built binary tree using recursion and included a function to print out the sum of the level of the tree of a given …

Member Avatar for codewalkz
0
357
Member Avatar for Laryssaparker

Hi, I am creating a Visual C++ application with a bunch of forms. I would like one form to stay open the entire time (just a screen to show app is running), then I need one form with two radio buttons, an OK button and a Cancel. If the OK …

0
83
Member Avatar for Jalwes

Hi all, I am trying to write code that will read from a file that is set up as an inventory file. So, on each line you'll have something similar to: 1. Toothpaste 2. Toothbrush etc... The problem I'm having is saving the numeric item number into one array index, …

Member Avatar for Jalwes
0
155

The End.