581 Posted Topics
Re: When you download and unpack the library. Its not ready to be used. Most of the librarys need to be compiled before being used. Maybe its the same case with this too .. [url]http://www.cplusplus.com/forum/windows/5259/[/url] This thread gives u a basic explanation on how to install.. If you have any more … | |
Re: [code] char inputFile; [/code] You have declared inputFile as a single character. So unless an until you only want to open a file which is a single character long, You can leave it the way it is and go ahead on changing your function. Or I guess you could change … | |
Re: It has to mainly do with the way you have declared the class [B]EmployeeData[/B] in [B]EmployeeDataList[/B]. [code] class EmployeeDataList { private: class EmployeeData; //Class data type for nodes. EmployeeData *head; //------- [/code] Since you have declared [B]EmployeeData[/B] inside [B]EmployeeDataList[/B] you should be defining the class like this [CODE]class EmployeeDataList::EmployeeData { … | |
Re: @planq007:Please use code tags the next time you post code on daniweb. | |
Re: Hello, I have just looked at your thread and have come up with a rather simple solution to part 'b' of your question. What you could do is. 1) Check if (denominator < 0 ) //this would determine if the value of the denominator is negative. 2)If (denominator < 0 … | |
Re: I would like to point to you one basic thing that you might have going bad right now. It basically is the place where you are collecting the data. [B]The getdata() [/B] is collecting all the data from the file into a local variable. This is bad, as the local … | |
| |
Re: There are many things in history that people want to forget. I think that all of us will agree on this, Lets not go that deep into hatred among people as its mostly an assumption (Though there might be truth in it. ) So people, Lets just stick to the … | |
Re: [url]http://www.chris-lott.org/resources/cmetrics/[/url] Maybe that will help. I never used it , but found it in the search results of google. | |
Re: as FirstPerson has told you . You should provide an interface for editing the variables but must not provide direct access to its members. Well if there is the question of Deleting records, or Adding New Records, I wonder if you are given a bound, For example the Max number … | |
Re: Please use code tags so that you'll get people interested in reading your code and faster answers | |
Re: [CODE]string convertWord(string word) { for(int counter=0; counter < word.size(); counter++) { for(int i; i < 26; i++) { if (word[counter] == alphabet[i]) { word[counter] = leet[i]; } } } return word; }[/CODE] You are trying to put in a string in-place of a character. That cannot be done. And secondly … | |
Re: What have you done till now? | |
Re: You should create a pointer to function, and then pass the functions address with a reference. | |
| |
Re: What do you need help with? The compilation errors are a minor deal. | |
Re: Hi Waway, Welcome to Daniweb. Here we follow a rule stating that every problem that we address must provide proof that they have really made an attempt to solve their problem. So could you please post the code that you have come up with till now and then ask for … | |
Re: The Problem with the above code is that [code] std::cout<<"MAX " << *max_element(list.begin(),list.end())<<std::endl; [/code] in this line, the function max_element doesn't know how to compare between 2 elements of type Student. If we send it an extra parameter [code] std::cout<<"MAX " << *max_element(list.begin(),list.end(),my_comp_func)<<std::endl; [/code] and if [code] bool my_comp_func(Student,Student); [/code] … | |
Re: However, Technically its possible if you write your own "string" class and place it in a std namespace :D | |
Re: Or get through it with a recursive function, End cases would be if either you finish all available values with you or total > required total. | |
Re: [QUOTE=jonsca;1220549]I'm trying really hard to come up with something but he has such an extensive website ([url]http://www2.research.att.com/~bs/[/url] if anyone doesn't know it) where he has answered so many questions already. I might ask him if he's going to come out with a new edition of his book covering C++0x in … | |
Re: [code] for(int i=2;i<x,i>x;i++) [/code] (i<x,i>x) doesnt make sense to the compiler. i guess you should use the (||) meaning "OR". | |
Re: [B][COLOR="Red"]Dont You Push My Buttons!![/COLOR][/B] | |
Re: Its probably finding the first argument ambigious as the compiler is considering -1 to be an integer. maybe try, [code] long double neg1=-1; cout<< pow(neg1,i+k); [/code] However i'm not sure whether this would work. | |
Re: strcmp is defined in <string.h> or <cstring> . Even if you include it. the function only takes const char* as arguments. So if you wish to use it. you can do this [code] if (strcmp(x.c_str(), need.c_str() ) == 0){ [/code] at your if loop . Or if you are checking … | |
Re: Maybe, opening the files with [icode] ios::trunc [/icode] opening mode open would help. | |
Re: You might consider some algorithms such as Breadth first search and Depth first search. and tweak them a bit :) | |
Re: [URL="http://www.daniweb.com/forums/thread573.html"]the answer to your question.[/URL] | |
Re: I think a copy constructor as it name suggests creates a copy of the class-variable that is passed to it as a parameter/argument. Unless the variable being passed has incremented the value.. I'm pretty unsure about it. | |
Re: What do you mean by "right integer values?" | |
Re: I dont understand whats wrong with the above piece of code. Considering that there is a number for sure after the '=' . it should work. | |
Re: the mechanism of calling the wait () function is faulty. [code] cout<<"Loading \n" ; for(int i=0;i<4;i++) { cout<<"." ; wait(1); } [/code] would do what you are expected of. You seemed to have understood the concept of function calling /basic syntax wrongly. | |
Re: EDIT----------POST doesnt provide any help. Please Omit -------EDIT | |
Re: unity, tin, mut, mom, yum,ton,tom, monty, tiny, ........ The Word Now is : Progressive | |
Re: interesting question. Array: An array is kinda like a collection of variables of the same data type. Each variable that is pointed out by an index value. [B][U]Creation of an array: [/U][/B] Consider the following code: [code] int arr[10]; [/code] Here we declare/define an array of '10' [COLOR="red"][B][COLOR="Red"][B]int[/B][/COLOR][/B][/COLOR]eger elements. of … | |
Re: Just like a normal variable :p This is an example code. if you need more help just ask . [code] const int size=10; int value[size]; for (int i=0; i < size; i++) { cout<<"Enter value - " << i << "- : " ; cin >> value[i]; //Assigning from input … | |
| |
Re: I haven't tried it, HOw about LAYS- SPANISH TAMATO :) (I love it) | |
Re: Could you explain what you meant by >>solve this recursively by going through the maze manually? | |
Re: i think [code] list::clear(); [/code] is what you're searching for. Read about it here [URL="http://www.cplusplus.com/reference/stl/list/clear/"]Click Me[/URL] | |
Re: And what is the variable " counter " set to ? | |
Re: [B]Recursive Function [/B]: [U][B]By definition :[/B][/U] A[B] recursive function[/B] is a function that either calls itself , or calls another function which in-turn calls itself. In rather simple words it means a function that performs [U]repetitive action until a goal is reached. [/U] Recursive Functions basically have 2 cases: 1. … | |
Re: I would prefer you post down the code that you've written till now.. Maybe then, we can help you out. Its pretty raw without understanding your exact problem | |
![]() | Re: I believe that you did define a constructor. Please be more specific about your problem. |
Re: [B]Add Record:[/B] Go to the end of the file. Add in a new record with the same format. [B]Delete Record:[/B] You could read in all the data, then omit the element that has to be deleted And Write back all the data. Just be sure that you dont open the … | |
Re: You can maybe convert double into String. and then display it. there are loads of ways to convert from int to string. using stringstreams etc. :) | |
Re: In Line 49, 53 you seem to be using [icode] = [/icode] in the place of [icode] == [/icode] the same case again in 73. Apart from those. The code in line 51 is always true and will be executed. I think you should think on what you are trying … | |
Re: Haven't gone through the code yet. But I think you will need to set the precision of cout .to attain that result. [code] cout.precision(2); cout << "Base Pay .................. = " << basepay << endl; [/code] | |
Re: Well, looking at the code you produced. the pointer struct1 is a local variable to myFunc1( ). So by the time the function call ends. the scope of struct1 ends. creating 2 problems 1) the dynamic array created remains unused. 2) The dynamic array is not deallocated with the delete … |
The End.