64 Posted Topics

Member Avatar for francisprite

You could try and write a very simplified chatroom program. You would need to write two programs: 1. The server, which accepts connections from all the clients. Collects messages from clients, and sends them to all the other clients. 2. The client, which gets a message from the user, sends …

Member Avatar for onkar81
0
277
Member Avatar for Sukhbir

If you are asking "why is overloading functions useful", then the answer is because sometimes we want two or more functions with the same name which provide the same functionality, but which require different parameters. Lets take an actual example and look at the append() function on std::string. Here are …

Member Avatar for Narue
0
126
Member Avatar for OmniX

To be a bit clearer, you can use the stringstream class like so: [code=c++] #include <iostream> #include <sstream> using namespace std; int main() { stringstream ss; // our stringstream object int a = 1, b = 2, c = 3; ss << a << b << c; // we insert …

Member Avatar for OmniX
0
169
Member Avatar for sbbs05

This is a prime example of how I see some students graduate in computer science and don't understand basic object oriented programming concepts. You need to figure this out yourself. Of course if you try and have most of it worked out but are hung up on something very specific …

Member Avatar for jencas
0
150
Member Avatar for daviddoria

I agree with Radical Edward - you may save some time switching from vectors to arrays (maybe half the time), but you may be able to structure your data so that you can perform your most often called operations in log(n) time instead of linear time. In this case a …

Member Avatar for ArkM
0
150
Member Avatar for Alex Edwards

By "taking the address" I believe it means using the address-of operator (&). An example of taking the address of something: [code=c++] int x; int* y = &x; // here we take the address of x and assign it to the pointer y [/code] The "definition" part it talks about …

Member Avatar for vijayan121
0
1K
Member Avatar for FTProtocol

The way you've structured your headers (.h) and implementation (.cpp) files is not very good and is probably causing the problem. Typically for a class you should always have a header file which you have header file "guards" and inside you declare the class. It should look something like this: …

Member Avatar for mahlerfive
0
115
Member Avatar for Labombadog
Member Avatar for ishanh

Sounds like a graph problem. You can use a graph, where each item (A, B, etc.) are nodes/vertices, and each one-directional link/edge implies a relationship (i.e. owns). There are a few ways to represent graphs in code, one way is with an adjacency list. Essentially this is a 2D list …

Member Avatar for ishanh
0
90
Member Avatar for dmanw100

Are you trying to convert a string of digits to a number you can do calculations with? If so, you can you atoi(). [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/atoi.html"]http://www.cplusplus.com/reference/clibrary/cstdlib/atoi.html[/URL]

Member Avatar for ArkM
0
181
Member Avatar for gispe

The first error means that the function ingresar_datos has never been declared - if you look through the code, there is indeed no function with that name. The rest of the errors are because the function prototype is slightly different than the function definition. For example, for menu you have …

Member Avatar for gispe
0
127
Member Avatar for Cosa

First thing, you should really rename tracklist to track since that struct is only storing info about one track. The main problem is that your album structure only can store one track. You will need to alter your album structure to be able to store a list of tracks that …

Member Avatar for Cosa
0
122
Member Avatar for micheal_lobster

I have only dealt with bitmaps (.bmp), but essentially you need to open the file, read in the header information (stuff about how big the file is, width, height, # of colours, etc.) followed by the image data. I'm assuming by dither or halftone, you mean to cut down the …

Member Avatar for micheal_lobster
0
618
Member Avatar for mahlerfive

My goal here is to write a small class to keep track of memory I allocate/deallocate so that I can more easily find memory leaks. To do this I overloaded the operators new, new[], delete, and delete[]. In those methods, I allocate/free memory as usual, but also make a call …

Member Avatar for Duoas
0
135

The End.