- Strength to Increase Rep
- +11
- Strength to Decrease Rep
- -2
- Upvotes Received
- 84
- Posts with Upvotes
- 63
- Upvoting Members
- 44
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
- Interests
- Reading/Music/Cricket/Football/Amateur Astronomy
- PC Specs
- Windows 7 and Ubuntu 9.10. Using acer aspire 5738 currently
429 Posted Topics
Re: don't worry .. ur not the only one.. :) [URL="http://www.daniweb.com/forums/showthread.php?t=120344&page=2&highlight=narue"]http://www.daniweb.com/forums/showthread.php?t=120344&page=2&highlight=narue[/URL] | |
Hi, i have seen a lot of ppl say things like, 'this piece of code is more efficient than the other', 'this gives better performance' or 'more efficient memory wise' etc.. but i fail to understand that how in a normal coding scenario can i find out the efficiency of … | |
Re: Header required for 'TButton' is missing i think. | |
Re: You probably need a class called 'Player' which has a stack data member of type card. You can use the c++ stack container which provides you methods to add/remove elements. You don't really need to learn linked list to understand how this container works but you should still learn about … | |
We have a small team of 5 software developers and we are handling products A & B. Last month we were also handed over products C & D from another team which moved to doing something else. Suddenly we have double the work and same number of people. Though we … | |
Re: Normally you would have an insert function which takes care of head node. Not sure why would you want to insert at tail directly. Also you can have insert_at or insert_after, insert_before functions which also handle adding a node to an empty list. Take a look at this tutorial here … | |
Re: Please post the compliation errors if you want quick help. | |
| |
I have a some libraries which have a lot of common classes but the namespaces are different. Most of the code I was writing could be easily reused by classes in both libraries so after some reading I tried a technique of using the templates to pass namespace. As you … | |
Re: I didn't really know what 'isalnum' does so i checked the c++ reference site and it says "Check if character is alphanumeric. Checks whether c is either a decimal digit or an uppercase or lowercase letter." So that seems to be the issue ? May be you should use 'isdigit' … | |
Re: Also when you declare a non-virtual function in a child class which has the same name as the base non-virtual function you end up 'hiding' the base function which might not work as you expect. The base class function is not accessible in the derived object now. Even if the … | |
Re: Are you learning C++ ? What material are you using ? Any decent C++ book or online resource should give you a good explanation of arrays and how they are used. Try this http://www.cplusplus.com/doc/tutorial/arrays/ | |
Re: > need some help again with finding the min and max from a text file And where is your logic to calculate min and max? What do you think the algorithm should be on paper ? | |
Re: To begin we need to know what have you tried and where are you stuck. If you post whatever code you've written we can help you fix it. It's also a good way to guage how much you already know and what level of details should be included in the … | |
Re: Why do you need an automata ? It doesn't look like you need to check for strings matching any regular expressions. Just load the contents of the documents as string and do a find for the required strings. | |
Re: There is a related article link on this page (i'm assuming you see it too) [File Display Proram](http://www.daniweb.com/software-development/cpp/threads/432845/file-display-progam) , Take a close look at the includes, the use of ifstream object for reading files, namespace std, cout etc.. That is the std c++ way of writing code. i'm guessing you've … | |
Re: Yes. You are subtracting ascii value of char with ascii value of '0' | |
Re: I don't know why you are getting this error, I would expect something like 'invalid use of non-static member in static function' error over here. Since getStaticGroupData is a static function of the class and mGroups is a non-static member of the same class and you are not allowed to … | |
Re: ans: i'm sure i will.. infact i just did !!!! qs: whats a question? | |
Re: I'm just worried how much data is being held by one particular company. And even though they say that they will not misuse the data, they do realise the kind of power it gives them in this e-society. Tracking people's transactions is going to be another such way to get … | |
Re: If you are really interested in learning C++ and becoming a good programmer, take all this advice constructively. Tomorrow when you go out to work in the professional world and do these mistakes, no one will point them out to you, they would probably just fire you. So, there's no … | |
Re: instead of an array you can use 'vector' to save unnecessary allocation of memory. | |
Re: Hi, Could you elaborate clearly what is it that you want to do and what are the issues you are facing ? | |
Re: @Salem: How does the link here 'from a stone age educational system.' help the OP and why did you think it was needed to be shared on this forum ? You didn't need to share it because every student in india knows this, there are a lot of factors behind … | |
I have been reading the 'inside the c++ object model' by Lippman and one of the sections has me a little confused. It is the section where the author explains how virtual tables are created and virtual pointers assigned, in the scenario of multilevel, single inheritance. If anyone here has … | |
Re: It looks to be this line [code=c++] for(node *temp=firstNode; temp!=NULL && temp->next!=NULL; temp=temp->next) [/code] Lets say you removed the one and only node in your list. In the code you hit the else part and do a 'delete firstNode', however you are not setting the pointer to null. Then you … | |
Have been reading about the facebook commenting API for a few days now. Sites like Techcrunch have gone ahead and implemented the feature. I tried imagining if it will make sense for a forum like Daniweb to enable facebook commenting ? To me it seemed that it will not make … | |
Re: Looking at your printmaze function it looks very likely that you have missed some matching opening and closing braces somewhere. Just try and ensure that. | |
Re: It seems like you want a subscriber-publisher model. There will be one publisher thread which calls a particular function on all subscribers every 60 seconds. The publisher can be a [URL="http://en.wikipedia.org/wiki/Singleton_pattern"]Singleton[/URL] and subscribers could just subscribe with a callback function to it. However if there is only 1 publisher then … | |
Re: On the same lines you could have a map that maps strings to function pointers. Provided you can have all functions to have the same signature (or if you can create delegate functions which have the same signature and internally call the respective functions) and then can directly call the … | |
Re: I copied and ran your code and it worked fine for me. On unix though. Btw main should have a return type of int and you should remove all the unnecessary headers and don't use System("pause") , use cin.get if you want to pause your program. Use couts to print … | |
Re: "I dont comment my code, if it's tough to write it should be tough to understand" | |
Re: Do you have the permissions to read the file/directory ? | |
Re: Welcome to Daniweb. Before anyone can help you please read this [URL="http://www.daniweb.com/forums/post365723.html#post365723"]Read this before posting[/URL]. Following the tips here will make it easy for people to understand your problem, read your code, provide a better solution and will help you make the most of Daniweb. | |
Re: And .. 1. line 22, You probably want to pass in the base address of the array. 2. For an array of size 10, index 10 will take you beyond the array into unknown territory 3. line 31, in the loop you go from 0 to 10 which is an … | |
Re: No you cannot inherit an array because if i'm not wrong it is considered to be POD(Plain Old Data) in C++ and doesn't have ctors etc. I don't see why a Matrix class should inherit any container. Containing an array or a vector seems like a logical solution to me. … | |
Re: On a slightly more pedantic note, [URL="http://www.daniweb.com/forums/post365723.html#post365723"]Read this before posting[/URL] :) | |
Re: Ok let me start with you :) Initially I used to think that you're a guy, because of your avatar at that time may be. As far as ur appearance goes you always bring up the image of my English teacher from school: very thin, tall and probably you wear … | |
Re: Also 'names2' and also the memory allocated in addEntry fn is not being deleted anywhere. | |
Re: 1->// only works if "using namespace std" exists, what's the problem? Because you have not scoped 'string'. If you don't specify, using namespace std, then you have to scope all namespace types with std:: . 2-> I don't see a problem with copying of vectors of strings bu why have … | |
Re: As far as I can see the heads array is empty and you have not-populated it before you access it in 'tableInsert' function. So heads[i] is actually undefined. Moreover you have a memory leak at line 97-98 since you declare a pointer to node and try to assign it to … | |
Re: Can you do something like [code=c++] ifstream dbfile(DB_FILE_NAME); if (dbfile.is_open()) { // functions are performed here. } else { ofstream newdbfile(DB_FILE_NAME); cout << "You have no database file. Creating one now..." << endl; dbfile << "# This is your database file.\n"; // Lots of irrelevant code omitted newdbfile.close(); // This … | |
Re: Can you try and explain the problem a little more? I can make out that you populate an array of cities and an array of species but what are you doing with the array 'x' (as an aside 'x' is not a useful name for a variable, please give it … | |
Re: Why are you creating the istringstream object in between? Just print the string. And move the cin.get outside the loop. | |
Re: <Ignore > When you do data[index] if the value of index is greater than the size of vector you can get a out-of-range error. Ensure that you are inserting at valid index or resize your vector </ignore> Sorry I did not see that you posted the output at the top … | |
Re: It's too abstract for anyone to help. I am not an expert at this stuff but if you need good feedback then post whatever code you have written and clearly mention the issue. | |
Re: If you just want to read from a file and print it to the output stream you can do [code=c++] std::string line; while(getline(infile,line)){ std::cout << line << std::endl; //outfile << line << std::endl; or this to write to output file } [/code] | |
Re: Is it mandatory to use arrays? If not you can look at vectors or other STL containers to make your life easier. |
The End.