49,761 Topics

Member Avatar for
Member Avatar for JaimeSharp

Now I HAve Written The following Programs [CODE] # include <iostream> # include <string> # define MAXSIZE = 300 using namespace std; bool findTitlePrice(string allTitles[300], double allPrices [300],int totalRec,string title,double price); string allTitles[300] = { "Book 1", "Book 2"}; double allPrices[300] = { 78.5, 66. }; int main () { …

Member Avatar for JaimeSharp
0
259
Member Avatar for bigcheesy

Hello, I am having some trouble figuring out an assignment I was given in class. I am not looking for any code, but need a better explanation that what the teacher has given. Basically the program will calculate the number of days between any two days from 1/1/1900 through 12/31/2099, …

Member Avatar for JeyHey
0
7K
Member Avatar for aryansmit3754

could somebody tell wats wrong with this #define FOR(x,n)for(typeof(x);x<n;x++)

Member Avatar for mrnutty
0
162
Member Avatar for abhi74k

[CODE=c++] class A { int num; public: A() {} A(int _num) : num(_num) {} A operator + (const A & ob) { return (num+ ob.num); } }; int main() { A ob1(1); A ob2(2); A ob3(3); A ob4=ob1+ob2+ob3; } My doubt is in ob1+ob2+ob3 . First ob1+ob2 is evaluated and …

Member Avatar for Aranarth
0
146
Member Avatar for new2programming

I am making a jump and run game- i want my sprites to collect items that are worth points. I want these items to be randomly generated on my tile map. Does anyone know how i can do this? I am using Visual C++ with SDL

Member Avatar for Aranarth
0
92
Member Avatar for kalrajhi

Hey guys, I am having a problem with this program. It's actually part of an example from Michael Dawson's [I]Beginning c++ Game Programming[/I] This program pretty much randomized a number between 1 and 100 and has the user input his/her guess. The user can deduce what the number is each …

Member Avatar for kalrajhi
0
250
Member Avatar for iamcreasy

I am new new in OOP stuff.I have read the Herbert Schildt's C++ reference.But it just gave me the idea, about how it work.Not how to make it work. I am read few chapters from "Object-Oriented Programming in C++ by Robert Lafore"(old edition featuring UML 1, i guess).But it was …

Member Avatar for avarionist
0
168
Member Avatar for Excizted

Hello, I have a derived class, that I'm trying to delete. This causes a segmentation error, though. I'm fully aware of the virtual destructor thang, but I'm using it all the way around, and still this issue occurs. I'll post my headers only, please tell if more is required. DataStream.h …

Member Avatar for Excizted
0
3K
Member Avatar for vilas_tadoori

Hi All, I have written reversible link list and pasting the code as below in c++. It works fine, please let me know if there are anything more that is required to make this more robust. This is on a single link list. [CODE] [COLOR="Green"] #include "stdafx.h" #include <iostream> using …

Member Avatar for vilas_tadoori
0
152
Member Avatar for Babatuda

Hello I am having some problem, can any body give me a helping hand each time I compile I get this error massage, I dont know where I made the mistake help please I new to programming[code]This is my Main File include libraries #include <iostream> //Call C++ normal imput and …

Member Avatar for avarionist
0
446
Member Avatar for r1409

hi all i have an assignment in which i have to use object-oriented programming to read from an input file(say: input.txt), use prim's algorithm and calculate the weight of a minimun spanning tree and then save the output to a file(output.txt). the problem with my code is that the program …

Member Avatar for daviddoria
0
633
Member Avatar for Jennifer84

Hello I am trying to compile my project in VC++ Express Edition and get the error below. The project did compile fine before I reinstalled XP windows. But now when I have installed everything again, I receive this error. I dont understand what this can mean ? When clicking the …

Member Avatar for Jennifer84
0
280
Member Avatar for rootchord

Been working on this for hours now. but most of it has been trying to fix these two errors. I've been googling my heart out and keep getting cryptic answers about the [B]const[/B]. Really need help. it's supposed to take in names of students and their scores, sort them, then …

Member Avatar for rootchord
0
635
Member Avatar for leesho

i have this code which input 3 numbers into ascending order. i know make it 10 i just change the array size but then it is only ascending the numbers that were inputing that are under 10. how can i change it so it's any number. [code]#include <iostream> #include <conio.h> …

Member Avatar for mrnutty
0
269
Member Avatar for tonymuilenburg

Hi All, I'm trying to figure out how to load images from a resource file into a picture box using a visual studio windows forms application in c++. I figured out two different ways to do this in c# by going through the forums, but I cannot figure it out …

Member Avatar for tonymuilenburg
0
1K
Member Avatar for tundra010

Hello everyone I know that one cannot pass a parameter to destructor functions in classes. Is there a reason why this functionality was left out of c++, and is there a way to get around it? Thanks!

Member Avatar for tundra010
0
102
Member Avatar for erka4444

I am trying to write a function which converts a number to a string. But when I return from the function, the reviving string - according to debug mode - still is empty, so the program outputs nothing. What am I doing wrong? [CODE=c] #include <iostream> #include <string> using namespace …

Member Avatar for amrith92
0
97
Member Avatar for tomtetlaw

Say I have an array like this: double *a; and I use new/delete[] to do memory allocation on it. How would I be able to delete certain elements from it? Like this: [code=c++] void RemoveElement(double *a, const double &element) { } [/code]

Member Avatar for tomtetlaw
0
94
Member Avatar for zyky

Hello, I'm writing a simple program implementing a list. You can add, remove, search, print and find the minimum element. My problem is that the program crashes if I don't add the 'system("PAUSE");' line before the last 'printf("Minimo = %d.\n", minimo(l));' call in the main method. Here is the code: …

Member Avatar for zyky
0
194
Member Avatar for Curt1337

Hi there everybody, I am currently studying for my university exams and need 2 make a function for the below scenario. The function must display the information inside the 2D array as you can see in my code I have tried but to no prevail. Any help will be GREATLY …

Member Avatar for Curt1337
0
294
Member Avatar for JaimeSharp

I am in a bit of trouble with this code it is due tomorrow need pointers the menu is displaying correctly but when i enter a number it locks up have i declared the switch statement wrong or is my menu declared incorrectly also in regards to case 4 it …

Member Avatar for JaimeSharp
0
122
Member Avatar for leesho

i have this code here which inputs the numbers and then adds them. is there a cheats way i can change it so that it inputs the numbers then puts them into ascending order. [CODE]#include <iostream.h> void getNumber(int &, int); void sum( int, int &); void output(int[ ], int, int); …

Member Avatar for s_sridhar
0
105
Member Avatar for yongj

I have NEVER had this experience before while coding my past assignments. For some reason, I keep getting this error that says [CODE]error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup[/CODE]. I looked it up on google and people have been saying it's because I should've created a windows …

Member Avatar for yongj
0
95
Member Avatar for new2programming

I am wanting to add the most simpelist count down timer available for Visual C++ with SDL. Does any one know of a good one i could try and use

Member Avatar for Ancient Dragon
0
65
Member Avatar for leesho

[CODE]#include<iostream.h> #include<iomanip.h> using namespace std; float number1, number2, number3; void readThreeNumbers(number1, number2, number3); void sortThreeNumbers(number1, number2, number3); void displayNumbers(number1, number2, number3); int main () { readThreeNumbers(number1, number2, number3); sortThreeNumbers(number1, number2, number3); displayNumbers(number1, number2, number3); } void readThreeNumbers(number1, number2, number3) { cout << "Please enter three floating-point numbers, space between them: …

Member Avatar for leesho
0
180
Member Avatar for rowley4

I have a problem with strncpy. I need to change the first parameter to char for it to compile. I am not sure how I should do it. In C# I can just [CODE]int v1 = 123456; string v2 = ""; v2 = v1.ToString(); // in C# this turns the …

Member Avatar for daviddoria
0
133
Member Avatar for daviddoria

I've seen a few posts on here talking about "databases" as if they were just files and using fstream to manipulate the file pointer, etc. I'm familiar with SQL, so it would be nice to simply be able to execute sql command (as can be done from vb.net) such as: …

Member Avatar for tesuji
0
230
Member Avatar for nksstar
Member Avatar for NathanOliver
0
26
Member Avatar for mahdi68

Hi , i write this code and i get error whene i run it !!! why i cant send a variable to array parameter ??? [CODE]#include <iostream> #include <conio.h> using namespace std; void main(){ int a,b,c; cin>>a; cin>>b; c = a+b; int array[c]; cout<<c; _getch(); }[/CODE] i get this errors …

Member Avatar for jonsca
0
120
Member Avatar for dimios

Hello there, I am trying to figure out the advantages of C++ STL containers over C. Correct me if I am wrong. a)in C++ containers classes are standardized. C doesn't have any standardized libraries for data structures beyond the native array type. b)each of these containers in C++ has member …

Member Avatar for NathanOliver
0
211

The End.