49,761 Topics

Member Avatar for
Member Avatar for tintin.iitk

class A { A& a; public: A(): a(* new A()) {} }; There is a huge flaw here and before I compiled this code I was hoping that it will fail to compile, But it didn't. At first I felt like I had a big flaw in C++ as it …

Member Avatar for gusano79
0
244
Member Avatar for jjf3rd77

I keep getting errors in my code. I can enter the first number 1 fine but then is says that letter c or a is not initialized. What am I doing wrong? This is what i have so far [CODE]// Exercise 8.13: ComparingRates.cpp // Application that calculates the amount of …

Member Avatar for mrnutty
0
121
Member Avatar for Iam3R

i have just written a small program on DEV C++. i have been using it for couple of months but i never observed this error. [CODE] #include<stdio.h> int main() { printf("Welcome\n"); system("PAUSE"): return 0; } [/CODE] could not create makefile I/o error 32 any idea? what does that mean

Member Avatar for Iam3R
0
93
Member Avatar for dmm

Can I change a file stream object's read position in C++? I mean I have a file with a series of integers separated by a newline character. Can I read the first five integers into some variables and then move the read position back to read the fifth integer one …

Member Avatar for dmm
0
629
Member Avatar for Ashishinani1756
Member Avatar for NicAx64
0
108
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
185
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
60
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
828
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

The End.