49,761 Topics

Member Avatar for
Member Avatar for mchin131

Hi all. I have code that looks like this: [CODE]void bubblesort (int arr[], string stringarr[]) { for (int i=0;i<5;i++) { for (int j=0;j<i;j++) { if (arr[i] > arr[j]) { int temp=arr[i]; arr[i]=arr[j]; arr[j]=temp; string strtemp=stringarr[i]; stringarr[i]=stringarr[j]; stringarr[j]=strtemp; } } } }[/CODE] It is a bubble sort trying to find the …

Member Avatar for mike_2000_17
0
255
Member Avatar for thecoolman5

hi, i have this code [CODE]#include <fstream.h> #include<iostream> using namespace std; int main (char argc) { for(;;) { fstream file; file.open("file.txt"); cout << "Enter new high score." << endl; double n2; cin >> n2; double n1; file >> n1; if(n1 > n2) { cout << "You didn't beat the high …

Member Avatar for thecoolman5
0
1K
Member Avatar for yazooney

Hi, I need the following headers. [CODE]#include "unistd.h" #include <sys/types.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/un.h> #include <sys/time.h> #include <netinet/in.h> #include <netdb.h>[/CODE] I been looking on the internet and find it hard to get downloadable versions of these headers. Instead, often I have to copy paste into a new file. …

Member Avatar for chevuru.anil
0
2K
Member Avatar for clickspiker23

i got c++ off amazon, no solutions are provided for the end of chapter exercises my problem is with getting larger numbers to be only two decimal places. i know about setprecision and how it works for the smaller numbers but when i enter a large number for days worked …

Member Avatar for clickspiker23
0
143
Member Avatar for hutzy

Ok straight to the point i have to do a code. The text or the word must have color and it is blinking but the text color should be automatic changing while it is blinking... I know how to put color amd make the text blinking but i don't know …

Member Avatar for Ancient Dragon
-1
387
Member Avatar for tomtetlaw

I have a pure virtual base class called IVSystemDLL. I also have a class called CVSystemDLL which inherits from IVSystemDLL. When I create a [icode]new[/icode] CVSystemDLL and convert it to a IVSystemDLL *, and try to use one of it's functions, I get an access violation. It's not something inside …

Member Avatar for tomtetlaw
0
2K
Member Avatar for gujinni

anybody know how to remove the repeated characters/// The output is like this.. string:aaaaanffddddgjkh result:afdgkh

Member Avatar for gujinni
0
187
Member Avatar for Geowil

Hey everyone, I need some major help. I was going to get some development time in on one of my projects when I found that my installation of VS2008 Pro no longer wanted to compile any projects. I have tried making empty problems with just the int main(), nothing else …

Member Avatar for Geowil
0
522
Member Avatar for mchin131

I am trying to use a linked list to read in data, do calcuations and then display it. I am new to using linked lists, so right now I'm only trying to display them to see if it works. [CODE]#include <iostream> #include <fstream> #include <iomanip> #include <list> using namespace std; …

Member Avatar for m4ster_r0shi
0
205
Member Avatar for gauravk_bhanot

[CODE]#include<iostream> #include<conio.h> using namespace std; class base{ public: base() { cout<<"base constructor"<<endl; getch(); } virtual void out() { cout<<"I AM BASE"<<endl; getch(); } }; class derived : public base { public: derived(){ cout<<"derived constructor"<<endl; getch(); } void out(){ cout<<"I am derived"<<endl; getch(); } }; int main(){ base b,*bp; derived d; …

Member Avatar for gauravk_bhanot
0
206
Member Avatar for ravigautam

Hello, I am new to C++ programming. Till now I have done some toy programs and classroom exercises. I want to develop a Virtual Drive software like PowerISO/Magic ISO. I searched Daniweb but couldn't get a thread where such problem was discussed. So from where should I start to develop …

Member Avatar for Ancient Dragon
0
269
Member Avatar for genie_02
Member Avatar for Ancient Dragon
0
31
Member Avatar for byrosport

Okay the text on my input file is Wxmv_bpm_xwl_jig_lwwza,_PIT._Q'u_awzzg,_Lidm._Q'u_inziql_Q_kiv'b_lw_bpib. Here's My code but for some reason I can't get my program to convert the message to my output.txt file. Can someone please help thanks [CODE] #include <iostream> #include <fstream> #include <cstdlib> using namespace std; int main() { string str; int …

Member Avatar for byrosport
0
281
Member Avatar for sudhanshu2

I have written a code but I am getting run time error : I have introduced all the error functions , but no error comes . Debug it with gdb which says : Starting program: /home/sudhanshu/OpenGL_ES/example/cube/cube [Thread debugging using libthread_db enabled] Program exited normally. What is the problem I am …

0
126
Member Avatar for clickspiker23

I created a program that ask a user to pick a service package and tell them how much it is going to cost, what i cant figure out is how to get the program to tell them how much they would have saved if they had gone with a different …

Member Avatar for WaltP
0
104
Member Avatar for riotburn

I am writing code where I have three header files: figure, triangle, and rectangle. Triangle and rectangle classes inherit the figure class. I have all the functions defined in the class declarations and don't need an implementation file. When I compile, I get this error: error C2011: 'Figure' : 'class' …

Member Avatar for riotburn
0
277
Member Avatar for clickspiker23

Im trying to complete exercises out of a c++ book that does not provide solutions. The first part was to just ask for internet package choice and output the cost of it as well as any additional fees. The part im having trouble with is: "Modify the program to show …

Member Avatar for Saith
0
180
Member Avatar for byrosport

I need help I have tried three times to make this program work and every-time I get more and more confused. Write a program that performs a threshold filter on a sequence of one-dimensional data. A threshold filter replaces values in an array with preset constants based on whether the …

Member Avatar for WaltP
0
284
Member Avatar for byrosport

Okay I need to create this Program and I have no Idea where to start. you will write a program that performs a threshold filter on a sequence of one-dimensional data. A threshold filter replaces values in an array with preset constants based on whether the values are in the …

Member Avatar for NathanOliver
0
306
Member Avatar for TheLittleEngine

Ok so I am stuck it's homework so I am not looking for anyone to do it for me i just need some help getting my mind on the right track. what i am doing is pretty much having the user enter a string of "$234,324,324.66" and have it print …

Member Avatar for sfuo
0
162
Member Avatar for thecoolman5

hi, how would you get a certain part of code to run while the program is waiting for the input? [CODE]string in; int n1 = 0; n1++ // get this part of code to loop while the program is waiting for the input cin >> in[/CODE] thanks.

Member Avatar for thecoolman5
0
888
Member Avatar for ben1996123

I want it to list prime numbers from 1 to 100 like this: 1. 1 2. 2 3. 3 4. 5 5. 7 etc. [CODE]#include <iostream> using namespace std; int main(){ int num = 1; double number = 1; double div = 1; bool prime = true; int top = …

Member Avatar for fibbo
0
156
Member Avatar for pseudorandom21

Anyone know of a generic guide for using third party C++ libraries, specifically with Visual Studio 2010? I'm thinking "winging it" isn't cutting it, I want a resource to learn more about how these things are usually prepared, and used. I swear I saw a mention of a library system …

Member Avatar for Ancient Dragon
0
3K
Member Avatar for atiyehjoon

hi my friends i have project.& I have to do it untill saturday(18 july 2011) please help me :( in this program should be read text file & show it And percent occurrence of each letter is displayed(no diffrent between capital or small letter .example :a=A) The number of words …

Member Avatar for Dexxta27
-2
150
Member Avatar for rayden150

If anyone could help this humble learner I would deeply appreciate it, Im trying to put this whole function, the couts in the middle but gotoxy() on a console application doesnt seem to work, im on windows vista and using codeblocks the latest version, Maybe I have a library wrong …

Member Avatar for Frederick2
1
477
Member Avatar for confused_one

Hi! I am using Dev-C++ and when I am trying to compile a program in it, it is showing many errors. All the settings seems to be right. Can I compile a program including header files like conio.h and iostream.h and using namespace std in Dev-C++? If not please suggest …

Member Avatar for Stefano Mtangoo
1
4K
Member Avatar for jashbela

[CODE]#include <iostream> using namespace std ; int main() ; { score and grade // declare variables ; float total_score // total weigted points ; char grade // letter grade ; int A , B , C , D , F ; // read in total score ; cout << endl …

Member Avatar for jashbela
0
330
Member Avatar for FoxInBoots

I have problem completing a program and I would be really really thankful if someone could help me with this . This is my code so far: [CODE]#include <fstream> #include <iostream> #include <conio.h> using namespace std; void registret(void); void lista1(void); void lista2(void); void search(void); void sortering(void); void addcar(void); void sell(void); …

Member Avatar for NathanOliver
0
124
Member Avatar for CPT

[code="C++"] class item { string name; string identifier; public: item( string name,string id):{this->name=name;this->identifier=id;} friend ostream& operator<<(ostream&, const item&); friend istream& operator>>(istream&, item&); }; ostream& operator<<(ostream& out, const item& temp) { out<<item.name<<" "<<item.identifier<<endl; return out; } istream& operator>>(istream& in, Cmessage& temp) { getline(in,item.name);//in case sring has space char getline(in,item.identifier); return in; …

Member Avatar for mike_2000_17
0
174
Member Avatar for learningcpp

Hi, I know that I can overlaod the operator >> and << and declare it as a friend function in the class for which i am overloading and then write the definition outside of the class. But recently I was writing a string class for myself only to learn and …

Member Avatar for m4ster_r0shi
0
347

The End.