Forum: C++ Jul 9th, 2009 |
| Replies: 4 Views: 216 @narendrachandu
Please read the forum announcements regarding asking code without any effort whatsoever. And continue with your other thread in case you decide to mend your ways. Closed. |
Forum: C++ Dec 17th, 2008 |
| Replies: 7 Views: 641 Templates make Template metaprogramming possible; you might want to take a look at it, pretty interesting stuff. |
Forum: C++ Nov 4th, 2007 |
| Replies: 5 Views: 1,485 You only/always free the memory which you explicitly allocated. If you dynamically allocate memory for a struct variable, you need to explicitly free it even though the members it contains follow the... |
Forum: C++ Sep 8th, 2007 |
| Replies: 9 Views: 1,508 n.aggel, maybe this (http://en.wikipedia.org/wiki/Category:Programming_contests) would help. Follow the links and you would find some really good sites, notable among them is Topcoder which has a... |
Forum: C++ Sep 7th, 2007 |
| Replies: 9 Views: 1,508 > I wanted to become a good programmer
Becoming a good programmer is all about using the right tools at the right time. Try to learn new very high level languages like Ruby, Python etc. Every... |
Forum: C++ Aug 6th, 2007 |
| Replies: 6 Views: 863 > Hi, I'm looking for a good program writing tools C++, have any suggestions?
What exactly do you need? As Jwenting pointed out, your question doesn't make sense. Do you need some kind of software... |
Forum: C++ Jul 31st, 2007 |
| Replies: 1 Views: 3,890 Nice snippet, though it would be better if you included the output so that beginners don't have to compile and execute your code to understand what is going on. |
Forum: C++ Jul 26th, 2007 |
| Replies: 6 Views: 2,536 Why do you want to return a 2D array which is a member of the class when all you are doing in the 'population()' method is make changes to the same array? You can just call the 'population()'... |
Forum: C++ Jul 25th, 2007 |
| Replies: 6 Views: 2,536 You can either pass the array considering as a sparse array i.e. by doing void someFunc(int** myArray) or you can pass it as a normal array by leaving off at the max the first dimension i.e. void... |
Forum: C++ Jul 25th, 2007 |
| Replies: 15 Views: 5,121 Implementation of instance methods should occur only once -- either in the header file or the cpp file. The error message say it all : you are providing a definition of your instance methods in both... |
Forum: C++ Jul 20th, 2007 |
| Replies: 47 Views: 8,852 > Java would be nice if Sun actually helped organize and certify the
> stuff that’s scattered all over the net.
I wonder whatever you mean by this... |
Forum: C++ Jul 19th, 2007 |
| Replies: 30 Views: 7,141 > did anyone ask you bench?
Bad attitude. First in another thread and now this one. If you keep up this, I don't think you would be getting any help.
Always learn with an open mind and smile on... |
Forum: C++ Jul 19th, 2007 |
| Replies: 6 Views: 19,280 Bench has given a good suggestion. But if you are not allowed to use maps, try using two parallel string arrays in which the location of the name of the animal and its description resides in the same... |
Forum: C++ Jul 19th, 2007 |
| Replies: 7 Views: 895 Mauro, more than 30 posts and you still don't use code tags? |
Forum: C++ Jul 19th, 2007 |
| Replies: 6 Views: 9,398 > Why?
Answer. (http://www.daniweb.com/forums/post191618-8.html) |
Forum: C++ Jul 19th, 2007 |
| Replies: 3 Views: 2,191 1. Define a structure.
2. Create an array of structures.
3. Read a line from the file and fill the array accordingly.
4. Accept input from the user.
5. Search the array given the input and pull... |
Forum: C++ Jul 17th, 2007 |
| Replies: 11 Views: 1,368 Right shifting 1 by 8, 16 or 24 times isn't going to get you anywhere. After a single right shift, the number will become 0 and 'AND'ing it with any number would make no difference. Oh and BTW, 0XF... |
Forum: C++ Jul 17th, 2007 |
| Replies: 62 Views: 11,455 A function with a base case(the terminating condition) and a recursive case, calling itself is known as Recursion. So whats basically happening in the above case is that to tackle the problem of the... |
Forum: C++ Jul 16th, 2007 |
| Replies: 62 Views: 11,455 Dump the loops, what you need is a recursive algorithm which would work for arbitrary lengths of arrays. One of the way is using 'Heap Permute'. Here is a sample program which you can easily adapt to... |
Forum: C++ Jul 15th, 2007 |
| Replies: 62 Views: 9,548 > I could have sworn that one fizzled out. Oh well.
See. You do this and wonder why the forum is a boring and dull place. :) |
Forum: C++ Jul 15th, 2007 |
| Replies: 62 Views: 9,548 > Which one was that?
This? (http://www.daniweb.com/forums/thread78320.html) |
Forum: C++ Jul 15th, 2007 |
| Replies: 30 Views: 7,141 libsdl is a better choice than BGI since it has a host of functions and has better tutorials and support on the internet than BGI. Considering that you have one entire month for making the game, you... |
Forum: C++ Jul 15th, 2007 |
| Replies: 6 Views: 898 > y c++ is not fully oops
Because it was meant as a OO replacement for C programmers. Also not everything is an object in C++. In pure OO languages, even a class in an object and everything which... |
Forum: C++ Jul 15th, 2007 |
| Replies: 62 Views: 9,548 Narue, before starting a new thing you must finish off pending business. We are still waiting for the results of the previous competition... |
Forum: C++ Jul 11th, 2007 |
| Replies: 7 Views: 5,257 > there is a function in c++ called strlen() which tells you the length of an array
That would only be for char arrays, not any array. |
Forum: C++ Jul 11th, 2007 |
| Replies: 23 Views: 2,860 > BORLAND C++ is the best!!
'Created a game using C++ and OpenGL' is much better thing to write on your resume than 'Created a game using Borland C++'. |
Forum: C++ Jul 11th, 2007 |
| Replies: 53 Views: 9,279 Every object you create can have a draw method, which will know how to render itself on the screen. So you just need to call the draw method of each object in a loop for all objects in the game. The... |
Forum: C++ Jul 11th, 2007 |
| Replies: 53 Views: 9,279 No, that won't work. Destruction of a class object has got nothing to do with the display. You would anyways need to actually 'erase' the thing which is on the screen. Thus your logic would consist... |
Forum: C++ Jul 11th, 2007 |
| Replies: 53 Views: 9,279 Like I said before, you need to read the function reference which is inbuilt in Turbo C to find it out since I have never worked with such things. Read something related to view ports concepts in... |
Forum: C++ Jul 11th, 2007 |
| Replies: 53 Views: 9,279 I am sorry I highlighted the wrong part.
The statement you ought to change is: string[25] = '/0';. It should be string[25] = '\0';, which is a null terminator. |
Forum: C++ Jul 11th, 2007 |
| Replies: 53 Views: 9,279 You should try to copy and paste the exact code provided to you, at least till you get the concepts right.
I pasted:
for(int i=0;i<24-1;i++)
{
string[i] = getch();
}
You wrote: |
Forum: C++ Jul 11th, 2007 |
| Replies: 53 Views: 9,279 Why a null terminator after each character input? I guess it was a typo.
char string[100];
for(int i=0;i<100-1;i++)
{
string[i] = getch();
}
string[i+1] = '\0'; |
Forum: C++ Jul 9th, 2007 |
| Replies: 53 Views: 9,279 I am afraid I don't know a lot about Turbo C graphics library and its specific functions. But for erasing the previous figure and redrawing it at a new location, consider erasing the particular part... |
Forum: C++ Jul 8th, 2007 |
| Replies: 53 Views: 9,279 Read this (http://users.aber.ac.uk/auj/voidmain.shtml). Simple and short answer: As far as the standards are concerned, main() always has returned an int as its exit status. |
Forum: C++ Jul 8th, 2007 |
| Replies: 53 Views: 9,279 This is happening because you are setting the fill color as well as the border color of the fill to the same color i.e. RED.
This is confusing the floodfill algorithm which checks the color of the... |
Forum: C++ Jul 8th, 2007 |
| Replies: 53 Views: 9,279 Maybe posting the entire code in code tags would help your cause. |
Forum: C++ Jul 8th, 2007 |
| Replies: 12 Views: 5,163 Computationally expensive. length() function is called each time the loop is executed. Why not something simple like:
int length = foo.length();
for(int i = 0; i < length; ++i)
cout << foo[i]... |
Forum: C++ Jul 8th, 2007 |
| Replies: 12 Views: 5,163 AFAIK, thats not standard C++. There is no 'for...each' construct in C++. Its C++/CLI (http://en.wikipedia.org/wiki/C++/CLI). |
Forum: C++ Jul 7th, 2007 |
| Replies: 53 Views: 9,279 Any point inside any closed figure. |
Forum: C++ Jul 7th, 2007 |
| Replies: 5 Views: 11,767 No you can't. You can only 'delete' or 'free' dynamically allocated memory. Plus the above statement won't compile. Go figure.
And please see the date of the previous post before posting in a... |