49,757 Topics

Member Avatar for
Member Avatar for raigs

I get this g++ warning when I use the [I]-Wconversion[/I] flag. Anybody know how to write this "correctly" ? [QUOTE]a.cpp:15: warning: conversion to ‘float’ alters ‘double’ constant value[/QUOTE] [CODE]#include <iostream> using namespace std; float VAR1(float VAR2) { int VAR3 = (int)(VAR2 * 1.045 * 1.55); // Result must be an …

Member Avatar for JasonHippy
0
1K
Member Avatar for NitaB

Hi, my name is Anita. I'm new to this forum and I'm here because I am utterly frustrated with this program that I have been working on for days. This program is supposed to ask the user a series of arithmetic problems and report on how the user performs. The …

Member Avatar for AAAKsu
0
184
Member Avatar for atch

Hi, I'm trying to initialize string with iterators and something like this works: [code=c++] ifstream fin("tmp.txt"); istream_iterator<char> in_i(fin), eos; //here eos is 1 over the end string s(in_i, eos); [/code] but this doesn't: [code=c++] ifstream fin("tmp.txt"); istream_iterator<char> in_i(fin), eos(fin);/* here eos is at this same position as in_i*/ //moving eos …

0
43
Member Avatar for Muathelbou

Anyone who can help me please do I am totaly lost. this is the homework: You will implement a set of functions that will analyze and/or manipulate character data. You are provided with a header file called charRoutines.h that contains the declaratins (prototypes) for the functions that you are to …

Member Avatar for tintin.iitk
0
223
Member Avatar for samsons17

how to display this output ? ********** ********* ******** ******* ****** ***** **** *** ** * ** *** **** ***** ****** ******* ******** ********* ********** thank you...

Member Avatar for tkud
0
365
Member Avatar for programmer01

hey guys, I have written a calculator program in C++. It suppose to get the input from the user which is a string. Some thing like ((5+3)/2)*5. If you input that expression it gives 20, which is the correct answer. The problem i am having is that it cannot compute …

Member Avatar for Naira88
0
2K
Member Avatar for johndory

Hello, I really need your help. I am writing a program to create a polynomial using linked list. The program is to perform different operations such as addition, subtraction, multiplication. I am however having problems setting the coefficients of this polynomial. I have an idea on how to implement the …

Member Avatar for fireprogramer
0
4K
Member Avatar for eliza2044

Hey guys, Does any of you have a clue how can I install the sqlite3 library on my computer? I'm using netbeans for building my application which now needs to handle a database. I already tried to compile the sqlite3 source code but the make command ends into a huge …

Member Avatar for eliza2044
0
493
Member Avatar for urmi

Hi; I want to connect MySQL database from turbo c++.I have installed MySQL 5.0.Also MySQL c++ connector.But it's not working.How can i connect.Any body have any procedure for it? Is it possible to connect it directly without any connector?If yes,then how?

Member Avatar for kvprajapati
0
100
Member Avatar for xueyingkoo

Hello, i already have C++ class few month , but i still find difficult to write the problem analysis on this project ... This is my question ... "Problem Specification A small scale Airline Company bought a new computer to computerize their airline ticket booking system. The company’s CEO asked …

Member Avatar for Skeen
0
2K
Member Avatar for python.noob

Hi friends, I'm using mandriva 2009 spring. I have a problem in compiling wxwidgets program in anjuta. I've done the things as said in the tutorial file->new->project->c++ tab->wxwidgets->project name,author->forward->folder name etc.->apply. It generated make files and all.It has a program to show a window as well in main.cc. [CODE]#ifdef HAVE_CONFIG_H …

0
59
Member Avatar for atch

Hi, Is it possible to have class template in non template class? I'm trying something like this and I'm getting errors: [code=c++] class Non_Template { //...other stuff public: template<class T> class some_Template; //declaration }; template<class T> //something WRONG with this syntax Non_Template::some_Template { }; [/code] Err msg I'm getting: error …

Member Avatar for atch
1
108
Member Avatar for samsons17

how to display this using for loop ? ***** ***** ***** * * ***** * * ***** ***** thank you for helping.

Member Avatar for restrictment
-1
356
Member Avatar for samsons17

#include <iostream> using namespace std; int main () { int a,b; for (a=1; a<=10; a++) { for (b=1; b<=10-a; b++) cout<<"*"; for(b=10; b<=a; b++) { for (b=1; b<=a; b++) cout<<"*"; } cout<<endl; } system("pause"); }

Member Avatar for VernonDozier
0
94
Member Avatar for yatman

Hi, I am trying to write strings to a file line by line and trying to format the output so that the alignment is proper. output should be it should appear in the output file as david 10 15 16 sam 11 15 16 but appears as david 10 15 …

Member Avatar for yatman
0
167
Member Avatar for bushimports

How can I draw text in a glut window with the keyboard; I have tried doing cin with [CODE] void TextBox::Keys(unsigned char key,int x,int y){ switch(key){ case 13://enter key cin >> String; DrawString = true; break; case 27: exit(0); break; } [/CODE] and then in the draw function [CODE] fontx …

Member Avatar for mrnutty
0
2K
Member Avatar for luvsom

I have to create a program that accepts 3 user inputs (hours, minutes, seconds) and then asks the user whether they want it to show in standard or military time. The main program should make 2 calls to the function DisplayTime, whether its true if they want standard time or …

Member Avatar for restrictment
0
142
Member Avatar for sebassn

Hey guys, I justs started this code to make a diamond with stars (*), but I get confused how to print the spaces that I need, I don't know if you understant what I'm trying to say. It is something like this: Prompt the user to enter (odd) height (of …

Member Avatar for restrictment
0
820
Member Avatar for dark1806

hi i m beginer in C++ programing.....can someone help me with a problem : i have to program the linux comand hostname in C++.....the c++ program should return the local hostname....thx

Member Avatar for Ancient Dragon
0
62
Member Avatar for newbie_to_c

Hello everyone, I need help with this code, which does not work properly. It prints fine at the first instant and when I convert it into a double it prints some unknown value. I am trying to get the maximum of all the values in the row. First: I cant …

Member Avatar for newbie_to_c
0
80
Member Avatar for blamp

can someone help me figure out why my output is incorrect any help would be apprecaited [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 multiFraction(fractions); …

Member Avatar for jonsca
0
102
Member Avatar for konefsta

im new with C++ . i was in java but now im learning C++ and i am not very good at it . i am making a program about spam and ham emails . i have all the files in the same directory . i created Ergasia1.cpp , Ergasia1.h , …

Member Avatar for jonsca
0
180
Member Avatar for ellimist14

ok I have to do standard database functions (add, delete, update records. print one record, print all records, etc) with a binary file. The only problem I'm having is, obviously with singular operations (add, update delet and print one) you have to perform a search to find the record you …

Member Avatar for Ancient Dragon
0
104
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
102
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
79
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
63
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
143
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
58
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
54
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
149

The End.