581 Posted Topics
Re: On the other note, Would Elements or Top be accessible if they are private? | |
Re: I dont know if this is the right place to post your question. Please visit the section of our forum dedicated to windows machines [url]http://www.daniweb.com/forums/forum99.html[/url] I hope that you will find your answer there :) | |
Re: [url]http://www.daniweb.com/forums/thread191370.html[/url] isnt this a double post? Well I dont know what subkeys are but the copy constructor error means that you cant use '=' operator to initialise another subkey, because its not defined. | |
Re: Actually There are a lot of Errors in Your Code. But Dont worry, It happens to everyone. Okay Firstly I think you should do this. Note the following points. A Function cannot be defined inside another function. They are separate Units. So Now go through your code and look for … | |
Re: iN THE FUNCTION void read( int **matr1,int **matr2,int& rows,int& cols,int& rows2,int& cols2){ What does mart1 point to? I mean You have not Initialised The variable for the matrix anywhere. | |
Re: if (delim[b]=fileWord[b]) Firstly Assignment "=" is not equal to Equal to "==". fileWord.erase)(i); This would report a syntax error. for(unsigned int a=0; fileWord.size ();a++) Where is the condition in there? for(unsigned int a=0;a< fileWord.size ();a++) You should also try using iterators to go through arrays. Another code improvment would be … | |
Re: I am writing an expression parser which acts as a calculator. Though i finished the first part. Now i am including user-defined functions into It. Been Working on it for 5 days . There is one bug that needs to be fixed. That is going on spoiling my Code. However … | |
Re: [QUOTE=tux4life;859644]I think you're already on a good way: you've already the skeleton of a class which will contain a flight's details ... [LIST] [*]Continue creating your Flight class [*]If your Flight class is ready, you could create a vector of it, that's a lot easier as you don't have to … | |
Re: Firstly get the input in an array. After that you can use a recursive function which takes in an element of an array and then only adds elements in front of it till the array ends. Another thing is you should specify the number of elements that you wish to … | |
Re: [QUOTE=musique;860709]Really? Cause it didn't sort the numbers...let me show all the code then...maybe it is just not displaying.... [code] /***This program dynamically allocates an array large enough to hold a user-defined number of test scores***/ #include <iostream> #include <iomanip> using namespace std; //Function prototypes int getnumtestscores(); void gettestscores(int[], int); void … | |
As i have written Atoi(); Now i have written Itoa. Here I have used a method of getting the last digit stroring it in an array and then reversing the array to get the required answer. I look forward for Improvements in this code. [CODE=C++] /**************************************************************************** Function Name:: itoa(int ,char … | |
Re: I assume You can first write a function which takes in the marks determines the grade and returns it. I think you should explain a little more about where exactly are you stuck at. | |
Re: [code] struct node { int value; node *head; node *tail; }; int main() { node *curNode = new node(); curNode->value = 1; curNode->tail= new node(); curNode->tail->head= curNode; curNode = curNode->tail; [/code] new node()??????????? I think you mean new node; there [code] struct node { int value; node *head; node *tail; … | |
I am getting a segmentation fault when i run the follwing program. This program takes in a const char* and returns the integer format. I also need advice on converting a C++ Octal or Hexadecimal Notationed string to an integer. Here is the code [CODE=C++] #include <iostream> #include <cstring> int … | |
Re: To read the matrix. Open the file. [code] while(!infile.eof()) { string x; infile>>x; dosomethingwith(x); } [/code] | |
Re: Dude , This is not a Homework Completion Service. If you have any problems with the code. We help find errors and provide ways of correcting them. | |
Here i have to define a function which will reverse a c-styled string. I have made 2 functions one using dynamic memory and the other not using dynamic memory. I would like to know of any improvements that can be made in the code. I would also like you to … | |
Re: Do you know what the for loop or the += operator is doing? | |
Re: Firstly you are returning a Fraction type but not stroring or displaying it. [code] Fraction frac=SumOfSeries(num); frac.display; [/code] Secondly in Function SumOfSeries Why are you introducing a for loop? [code] #include "Fraction.cpp" #include<iostream> using namespace std; Fraction SumOfSeries(int n);//adds fractions from num to 1 int main() { int num; cout<<"Enter … | |
Re: This program is quite simple. I think you are getting confused at this [code] t = t + 2 * c; [/code] I assume you should read it in the order of processing of the compiler. [code] t =t + (2 * c); [/code] This is the same when it … | |
Hey all, I have decided that in order to learn i will need to write code. So i am working on all the questions on my book. And as I am teaching myself i end up with no-one to scrutinize my code. [code=c++] #include <iostream> /************Declarations of Functions*********/ void func1(); … | |
Hi all, I have defined a function cat which takes in 2 cstring arguments and returns out a pointer to a new cstring which cocatenates the 2 strings I am having 2 problems with it. the cout statement doesnt work and secondly i get a runtime error while i delete. … | |
Re: I think you should send the argument "word" as a reference and not copies of the argument. | |
Re: I think you are searching for this [url]http://www.cplusplus.com/reference/string/string/find/[/url] The FInd function is built in in strings to search and find substrings. It returns -1 if the substring is not found or returns the position of the string if it is found. | |
Re: [QUOTE=Narue;853101]>std::transform(msg.begin(), msg.end(), msg.begin(), std::tolower); Congratulations, you've propagated one of the more annoying bugs among C++ help forums[1]. 1) tolower isn't just a function in <cctype>, it's also a template in <locale>, which is allowed to be included by any standard header (<iostream> is the usual culprit). As written, there's an … | |
Re: Show us the code that you have come up with. or I mean where do you need help at? | |
Re: Well you are infinitely running the loop. with your function call. [code] string foo("foo"); string barbar("barbar"); [/code] With the above code, Your Professor is assigning the values foo and barbar to the variables through a constructor. [code] void string::swap(string first) { string second; first.swap(second); } [/code] With this code you … | |
Re: [code] #include "..//Folder_Name//File.h" [/code] or [code] #include "../Folder_Name/File.h" [/code] I think this should work out. You need to traverse to the previous directory and then to a sub-directory. | |
Re: Does the 2 second time gap symbolise 2 seconds or is it exactly 2 seconds? [url]http://www.cplusplus.com/reference/clibrary/ctime/difftime/[/url] This will help you get the 2 second delay you want. If you use the link and the example in that link properly. After that it might be very easy. | |
Re: Firstly i dont prefer using your own version of duplicate assasin ;) I prefer unique_copy function in the standard library. [code] unique_copy(x.begin(),x.end(),y.begin()); [/code] Would do the trick. | |
Hello all, I am solving some of the exercises in a new book of C++ I am having trouble in declaring [quote=THE C++ BOOK]A Reference to a array of 10 Integers[/quote] Its on the 19TH and 30th line. I have the total code over here. [code=c++] //Declarations for all the … | |
Re: CARGO i recommend that you use code tags next time. Secondly instead of converting in an arphadox manner. Why not use the library function. [code] toupper(); [/code] [url]http://www.cplusplus.com/reference/clibrary/cctype/toupper/[/url] The above website will show examples on the usage ;) | |
Re: [code] reqList = new list<string>[6]; [/code] I doubt this code. [code] list<string> reqList(6); [/code] might be the correct way to do that. | |
Re: Well, A simple solution would be to read in all the data. Find the person whose data needs to be edited. Then after that. Edit the data. Then Write the file all over again . | |
Re: Guys instead of USING AN ARPHODOX method to solve your conversion from char to numerical. Why dont you use the atoi() function built in. That way you will not need to care abt any format. [code=c++] string a; unsigned short int Sum=0,i; a="12522"; for(i=0;i<a.length();i++) { string b; b=a[i]; Sum+=atoi(b.c_str())]; } … | |
Re: Notice that in all the input you are getting from the file, You have an extra " " space after the "," (Comma). So I think that the code should actually be [_CODE REMOVED_] | |
Re: i seriously donot understand which part of the code do you think is the problem and secondly .. What the problem is. Please Explain. | |
Re: SOUNDS LIKE MISSION IMPOSSIBLE. This will self destruct in 5-4-3-2-1 BOOM!!! :) | |
Re: [code] int[3][2] oppo_pos = { [/code] Shouldnt that be [code] int oppo_pos [3][2]={ [/code] | |
Re: You can use strcmp() function to check the strings. Secondly. I would also recommend that you get all the input in lowercase with tolower() function for each character of the string. THis is because ADD!=add!=adD | |
Re: [QUOTE=lauren316;838658]Can anyone tell me what I am doing wrong in this code? The output window allows me to input the string, but does not output whether or not it is a palindrom. There are no build errors Thanks in advance! Lauren [code] #include <iostream> #include <deque> #include <string> #include <cctype> … | |
Re: Fire up google and learn the basic FILESTREAMS. After doing that, the rest will be very simple to understand. If you have any prob after that. Then you can post your question up. | |
Re: [code] if(no>=10) { j=no%base; for(int k=0;k<j;k++) arr[i]=a+k; i++; no=no/base; } [/code] I would like to know what are you trying to do here. FIrstly you are converting the alphabet character 'A' into an int. ANd then secondly after the for loop is done it would just add (a+j) in the … | |
Re: Firstly. You have no function call back to main after you have entered the data. So it probably thinks that the program ends there . You have commented the menu function in add end and have not mentioned it in addstart. Secondly. to add the book to the start of … ![]() | |
Hi all, I have just created a template for my website and then have put in my GOOGLE Adsense script in it. When i open it with Internet Explorer. The page gets displayed nicely. But when i open it with Mozialla Firefox it doesnt display any Adsense ads. Secodnly the … | |
Re: You should try googling it out [URL="http://lmgtfy.com/?q=brute+force+search"]Clicky[/URL] Though its very easy. | |
Hi All, I have taken up this home project just for my pastime. My objective is to take a html file and then make a complete new webpage with a specific keyword. It basically is a find and replace type of method where my existing file contains a specific keyword … | |
Re: I am not sure. But [code] tempnum /= tempnum ; [/code] You are dividing a number by itself which would result in being one right. I think it should be [code] tempnum= (tempnum-tempdig)/10; [/code] This way the last digit can be removed . If that is what you want to … | |
Re: Well . I think : when the compiler starts reading your code. it goes into the (set error message function) and then looks at a class B .. which doesnt exist until then . --------------------------------------------------- Secondly. There is no need for the class A to be in class B. So … | |
I have to find the sum of the prime numbers below 2million so here is the program that i have written. [code=c++] #include <iostream> using namespace std; bool is_prime(int); int total=0; int main() { int num=2000000; for(int x=1;x<=(num);x++) { if(is_prime(x)==true) { total+=x; cout<< total<<"\n"; } } cout<< total; return 0; … |
The End.