49,755 Topics

Member Avatar for
Member Avatar for hamidr

when i compile a simple program in Dev C++ i get error:" conflicting types for 'myf' " [CODE]#include <stdio.h> #include <stdlib.h> int main() { myf(3.0); return 0; } double myf(double x) { return x; }[/CODE] what does that mean?

Member Avatar for Ancient Dragon
1
74
Member Avatar for Juggler

I have a question about manipulating an array in C++. In my program, a cstring is entered. The string is printed. Finally, the string must be printed in reverse and displayed. The final part is where I am having my problem. I have the strlen function determine the legnth of …

Member Avatar for Juggler
0
219
Member Avatar for spacecowboy123

Hi all, I'm new to C++ and am having a problem with a piece I am writing for an assignment. The problem area is below. [code] //arrival process on the corporate links if (clock % 4 == 0) { double randomno randomno = randgen; // Generate random number if (randomno …

Member Avatar for spacecowboy123
0
2K
Member Avatar for matrimforever

In the following code, how do I change the line under [code] cout << "\nThe value of bogus in num1 is " << num1.bogus;[/code] to get it to compile correctly. I know its calling for theValue which is private. Not sure what to change to make it work: [code] #include …

Member Avatar for matrimforever
0
104
Member Avatar for amen

i want to get token from string using string class. i know that using cstring, i can use strtok.can i use it? [CODE] #include <iostream> #include <string> using namespace std; void echo(string message) { cout << message << endl; } int main() { cout << "Enter your word: "; string …

Member Avatar for ~s.o.s~
0
113
Member Avatar for SlightlyAngelic

[code=c] #include<stdio.h> #include<math.h> # define I 0.0765 //Interest Rate char fname[20]; char lname[20]; float loan = 0.0; int years; double PB; //Prototypes double Mortgage_Calc(void); void Financial_Report(void); int main() { printf(" *******************Caribbean Mortgage Company*************\n\n\n\n\n"); printf("Enter the Customer's Name (First Name and Surname)\n"); scanf("%s%s",fname,lname); printf("Enter Requested Loan Amount\n"); scanf("%f",loan); printf("Enter Number of …

Member Avatar for Salem
0
131
Member Avatar for matrimforever

Hi all, I need help turning this: W = 35.74 + 0.6215t - 35.75 (v0.16) + 0.4275t(v0.16) into code. I guess the real problem is the how to turn v to the .16th power using this function: double pow(double [I]x[/I], double [I]y[/I]) I know how to open a file with …

Member Avatar for matrimforever
0
164
Member Avatar for suep

[B]Is their a way of using windows98/Me to make a chart?Or lines goes up or sqares?Or how can i make a chart?[/B]

Member Avatar for ~s.o.s~
0
84
Member Avatar for Manas Kumar Sen

I am using Dev c++ IDE for c and c++. When i run an aplication the running window disappears quickly. What should i do?

Member Avatar for Anonymusius
0
63
Member Avatar for newbie2c++

I am totally stuck on this problem and would love it if anyone knew how to help me fix it! Thanks for any input!!! Here are directions: Write a program that asks the user for a positive integer value. The program should use a loop to get the sum of …

Member Avatar for WaltP
0
323
Member Avatar for phuduz

hey guys heres a program thats suppose to assign a letter grade to a given percentage on an exam and i just keep gettin the same three erros at the bottom saying i have undeclatred indentifiers but i dont see how so any help would be very much appreciated [code] …

Member Avatar for phuduz
0
91
Member Avatar for chubbywubba

i have to make a minesweeper game for class, 3d none the less using microsoft visual c++. i have created my dynamic class. there needs to be a node class and a grid class. i have no clue how to do it. if you can help please help me, its …

Member Avatar for Ancient Dragon
0
104
Member Avatar for sunny123

this is a progarm i have created to calculate srudent grades given the three grades. the computer then works out te average and assigns a grade depending if average is more than 50. the program stops after giving the average of the three grades and doesnt output whether pass of …

Member Avatar for Anonymusius
0
125
Member Avatar for pengwn

The code below gives : Data is : hello srikanth its me Data is : Data is : Data is : [code]#include <string> #include <iostream> #include <boost/regex.hpp> boost::regex e("(\\w)\\s*(\\w)\\s*(\\w)"); boost::match_results<std::string::const_iterator> what; int main() { int i; const std::string input = "hello srikanth its me"; boost::regex_match(input, what, e, boost::match_default | boost::match_partial); …

0
66
Member Avatar for pengwn

Can someone help me out code using the below to get the equivalent program as beneath: [B] boost::match_results<std::string::const_iterator> what; boost::regex_match(input, what, e, boost::match_default | boost::match_partial)) [/B][COLOR=#0000ff] [/COLOR][code]#include <iostream> #include <string> #include <boost/regex.hpp> int main() { std::string s = "who, lives:in-a, pineapple under the sea?"; boost::regex re(",|:|-|\\s+"); boost::sregex_token_iterator p(s.begin(), s.end(), re, …

0
78
Member Avatar for Brent.tc

I need help with using the cin command\function. Any time I try to use it outside of the main function it does not work what am I doing wrong?

Member Avatar for WaltP
0
108
Member Avatar for paradoxxx

Can anyone help me with this project, I cannot figure it out. Enter characters one by one until a predetermined “sentinel” or the maximum number of characters is entered. The maximum [B]MUST[/B] be less than 96. The sentinel character can be any character other than an italic alpha or, space …

Member Avatar for Ancient Dragon
0
111
Member Avatar for e21_kam

Hi, I am doing a part time degree and need some help to finish off some code for my first assignment in C++. I have written a program which checks some inputted int's and strings, validates them and outputs the result. The last thing I need to do to finish …

Member Avatar for e21_kam
0
198
Member Avatar for Lutzee

Hi there, im a c++ noobie. I have a class called node. Node has a data member id. When i try and access id in the obect named f outside of main visual studio 2003 gives me the errors: : error C2065: 'f' : undeclared identifier error C2228: left of …

Member Avatar for Salem
0
113
Member Avatar for pitopito

Hi, My goal is to perform a single SQL query (“select xxx from yyyy etc etc”) to a Database over a LAN, using BORLAND C++ 4.5 and managing USERNAME and PASSWORD. I tried 2 methods so far : Method N.1) I used “Tquery”, TdataSource and TDBedit components linked togheter and …

Member Avatar for Ancient Dragon
0
108
Member Avatar for FireSBurnsmuP

Alright, I cannot get the getline function to work. I have iostream included, using namespace std, and here is the syntax I have down: [inlinecode]cin.getline(playerOne, 21);[/inlinecode] with playerOne declared previously as a string, and I want its max input to be 20 characters. What's going on here? It's not working …

Member Avatar for WolfPack
0
148
Member Avatar for matt611

Ok our teacher gave us a .h and .cpp file for a class called "JarType" and our assignment is to overload some of the math operators. Now I know how to overload operators if I'm adding two JarTypes together. What I'm having a problem with is overloading when I have …

Member Avatar for WolfPack
0
108
Member Avatar for LieAfterLie

How would you change the same member of many objects of the same class (or structure if possible)? [CODE]struct point { float x, y, z; } point a, b, c; a.x += 20; // b.x += 20; // now how would i do this in one statement? c.x += 20; …

Member Avatar for LieAfterLie
0
78
Member Avatar for Barefootsanders

Hey guys. Ive been working with fstream for about 2 hours and i give up. My problem is I have a text file with an unknown number of rows. Each row has a known number of items. i cant figure out how to read the elements in each row. after …

Member Avatar for Barefootsanders
0
69
Member Avatar for aznballerlee

I just got my C++ assignment today, and I don't understand it. Here are the instructions. The topic is on DDR (Dance Dance Revolution) [B]Your task[/B] For this project, you will implement the following two functions, using the exact function names, parameters types, and return types shown in this specification. …

Member Avatar for Ancient Dragon
0
69
Member Avatar for ReDeViL

Write a program that accepts a number and produces a pattern as shown in the following sample outputs. Line = 3 *.* .* * Line = 8 .*.*.*.* *.*.*.* .*.*.* *.*.* .*.* *.* .* i've just learnt to use the setw() command..... but how do you fill up the alternate …

Member Avatar for ReDeViL
0
134
Member Avatar for taruj83

hi, i need to write a c++ program that takes input of a expression like say y = 5 + 2b; and gives out the output y = 5 + 2b it uses linked lists and the expression can be composed of integers, variables and operators. the encoding of tokens …

Member Avatar for iamthwee
0
97
Member Avatar for nono909

Hello, i'm trying to write in the main program a linked list of namesfractions, and integres. i don't know if anyone can help me in this. i attached the fraction class and the implementationUsing the linked list class we derived in class, and the following functionality:[LIST] [*]A print function (you …

Member Avatar for iamthwee
0
83
Member Avatar for Eadams20

[code] #include <cmath> #include <iostream> using namespace std; //Function prototypes void getPrice (float&); void getInterestRate (float&, float&, float&); void getDownPayment ( float&); void gettradeIn (float&); void calcmonPayment (float, float, float, float, float, float&); int main() { // Input variables float price; float downPayment; float tradeIn; float loanAmt; float annualIntRate; float …

Member Avatar for Nick Evan
0
100
Member Avatar for easy

im just doing a little exercise on the bubble sort algorithim, i included two ways of incresing its speed. 1. Breaking out of the loop if no swaps are made 2. Decreasing the inner loops lenght each pass I think there is two ways of doing it. This way i …

Member Avatar for WaltP
0
75

The End.