49,761 Topics
| |
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 … | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
anybody know how to remove the repeated characters/// The output is like this.. string:aaaaanffddddgjkh result:afdgkh | |
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 … | |
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; … | |
[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; … | |
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 … | |
what is the step by step procedure to make your program run... using c++ | |
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 … | |
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 … | |
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 … | |
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' … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
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 = … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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); … | |
[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; … | |
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 … |
The End.