49,761 Topics
| |
Please help me with my assignment in c++! Write a program that will input 10 numbers and display the sum in a ASCENDING ORDER. please help me i really need this badly... | |
I am having trouble getting Windows to open the file "results1.txt" in the directory "Result Sets". When I run it I get the error: "results1.txt" is not a recognized as an internal or external command, operable program or batch file. But when I check to see if the file is … | |
Hey guys, I do have a main function and need to write the class. I just need to where should I start. I am a new in C++ but the prof. asked us to write the class code of this calculator. He already gave the main function and the purpose … | |
I return with another perplexing issue that I just can't figure out, a generic and unhelpful"std::bad_alloc at memory location" error. Before I get to the code, some background... Having finished my uber-awesome 2D engine (thanks entirely to you guys) I decided it was time to break open the can of … | |
Hey all, I am fairly new with C++ and I registered here to ask for suggestions on how I can create my project. I proposed to my professor that I will create a scientific calculator with "additional functions". By additional functions I mean like a SC with that can solve … | |
Im having trouble fixing this error on my program. Any help would be greatly apprecitated. [code=c++] #include <iostream> using namespace std; int main () { char choice; cout<<" Is it after 12 noon? (y/n)" <<endl; cin>>choice; if (choice == 'y') cout<<" Good afternoon, world!"<<endl; else if (choice == 'n') cout<<" … | |
I am not asking anyone to design the parser for me, this is something i would like to do myself so that I can learn how to do it in the future. I am entering into a IEEE 24 hour programming contest with two other people. I have the problems … | |
I am confused as to why I am getting this on GCC. I have all the flies in the same directory, I have have closed the compiler and reopened it and I am still get this error. I am getting oters too but I am sure that can be fixed … | |
Hello guys. After some time searching around the forums for a thread about an e-book for crash course from C++ to Java and no luck I decided to post a thread about it. So my question is,does anyone has or knows such book? Thanks in advance. | |
#include <iostream> #include <stdio.h> #include <fstream> #include <string> using namespace std; int main() { int number_Of_Lines_To_Print_From_End=0; char file_name[20]; streampos length; cout<<"enter file name that needs to be opened\n"; cin>>file_name; cout<<"enter number of lines to print from end of file\n"; cin>>number_Of_Lines_To_Print_From_End; fstream file; file.open(file_name, ios::out ); if(file.is_open()) { cout<<"the file opened\n"; … | |
Here is my code: [ICODE]#include <iostream> #include <string> #include <iomanip> #include <cmath> using namespace std; int main() { const double e = 2.71828; double t, f, n, B, VoltageGain; cout << "Please enter the time in hours the culture has been refrigerated: "; cin >> t; cout << endl; while … | |
In unix if you create and open a file by using 9 digits numbers in the open function it seems to work but in C++ you only don't have a parameter to do that rather you have ios_base. Just wondering if there are owner,group and world settings that can be … | |
Hi everyone. I want to read a file and store each word in an array. I also want to know how many words there are in the file. After I do this, I want to reverse the words from two different files and see if they are anagrams. Here is … | |
[ICODE] #include <iostream> #include <algorithm> #include <string> using namespace std; struct employees { int em_id; string em_name; string position; string gender; }; void read(employees record[], int max_1); bool IDsort(const employees &a, const employees &b) { return(a.em_id < b.em_id); } char Namesort(const employees&a, const employees &b) { return(a.em_name < b.em_name); } … | |
O_RWDR opens a file for read and write and pmode allows you to specify permission for each of the users? WHAT DOES IT MEAN BY WHAT PMODES AND O_RDWR ARE AVALABLE ON YOUR SYSTEM? CONSIDERING I AM USING VISTA I HAVE NO IDEA. I HAVE THE ABILITY TO READ AND … | |
I have a little special question about the for loop. Normally you could do the count as I have declared with a count from 0 - 10. What I do inside the loop is to identify many scenarios if the count should start from 0 - 10 or vice versa … | |
Hi all. I recently wrote a python program that takes a screenshot of the current active window. After taking that screenshot, it saves it as a bmp (using PIL), and then goes thru each pixel, looking for a certain color. If it finds that color, it moves the mouse to … | |
Hello everybody, I want to create a program that removes the first line from a text (csv) file (which is a header). I used this code: [CODE] string deleteline = "Name, ID, D.O.B, etc., etc."; //contains the Header information to be removed string line; ifstream sup; sup.open("DOWNLOADED_DATA.csv"); ofstream temp; temp.open("temp.csv"); … | |
I really need help with this guys. This compiles and runs but does not give me the right output. tfile.data: Seth 19 1.7 Austin 20 1.8 Michael 21 1.9 [code]#include <iostream> #include <fstream> using namespace std; int main() { ifstream fin; fin.open ("tfile.data"); if (fin.fail()) { cout <<"ERROR"; exit(1); } … | |
Hi yall, So what my code is supposed to do is basically count the number of paranthesis that the user enters and hit me back with the result. The code below works perfectly when there are no white spaces in the user's input. But when white spaces are present, It … | |
Hi all, I am a first year student at the university of South Africa. I am doing my degree via correspondence, thus no lectures. I am working through the prescribed book as best i can but they still assume a little bit of fore knowledge of programming which i don't … | |
I need help with my homework assignment for school. I was able to get everything to work fine when I just put everything in int main() without using functions but when I tried to separate everything into functions the program is not running correctly and although I don't get an … | |
hello I am trying to desing a simple rss feed reader, I am using curl to load the source code of a webpage and store it in a string and create an xml file, I then use xerces-c to parse the xml file, this works well but i need to … | |
hello I am trying to design an rss feed reader using xerces-c and im using dom parsing, I am new to this side of programming and everything I know so far is self taught. I can read an xml document that is in my computer but I can't access external … | |
I made 2 classes, Point and Point3D: Point.h: [code] #ifndef POINT_H #define POINT_H #include <iostream> template <typename T> class Point { protected: T X,Y,Z; public: Point(const T x, const T y, const T z) : X(x), Y(y), Z(z) {} T getX() {return X;}; T getY() {return Y;}; T getZ() {return … | |
Hi..i saw this a randomly..i got some part don't understand: [url]http://www.daniweb.com/forums/thread214624.html[/url] @ancient dragon's reply 1) const unsigned int MAX_SIZE = 2; student array[MAX_SIZE]; Q: Why MAX_SIZE = 2 ? 2)15: void insert(student array[],const unsigned int MAX_STUDENT); 33: void mySort(student array[],const unsigned int MAX) 55: void display(const student array[], unsigned int … | |
I am new to programming in C++. I have a bit of experience in Python and ActionScript3. I decided to pick up C++ so I downloaded Dev-C++ complier. I tried to run the following code but it doesn't seem to do anything. I complied the code, and it did not … | |
I haven't wrote in C++ for a long time so I decided to brush up a bit by writing some basic programs. I wrote a class that allows for basic arithmetic of infinitely large numbers (or as much as you have memory for). Here is the code. [CODE] class largeInt … | |
Hey i have a simple output program that i can't seem to figure out Home Owner Price of Home Seller's Cost Agent's Commission Garcia *****100000.00**********6000.00**********1500.00 | |
[CODE]#include <iostream> #include <cstdlib> using namespace std; const int arrSize = 100; bool isPresent(int ,int ); int main() { int myArr[arrSize]; int input; for (int i=0; i<=arrSize; i++) myArr[i]=rand()%200; //creating array with random numbers //sorting random numbers for (int j=0; j<=arrSize; j++){ for(int k=0; k<j ; k++){ if (myArr[j] < … |
The End.