General C++ Programming - August 2011 (Page 3)

interview questions
 
Does anyone have any links to code problems? I am looking for code problems where the question is "What is wrong with this code?" Or "What does this code...
[5 replies] Last: Thanks for your link! It's interesting. (by helianthusdd)
extremely weird behaviour by the simplest of functions
 
For the life of me, I do not understand why a single call to this function (from the main program) executes this function multiple times (about 50 - 70). This i...
[1 reply] : Post all of your code. (by hamsterman)
a problem about typedef keyword
 
Will you please explain me following typedef: typedef WCHAR TCHAR, *PTCHAR, PTSTR; (Term means: WCHAR – wide character TCHAR – generic character *PT...
[2 replies] Last: Thank you very much . I got . (by misserwell)
How do I use a call-by-reference char??
 
I don't know how to use a char in a function where I call it by reference. Here is my code. The idea is converting 24hr to 12hr time. int twelvehour(int h...
[1 reply] : | should be ||, even though I don't think it can do any harm. fabs do... (by hamsterman)
Class access specifiers - Very confusing programs - Help please
 
Hello friends, I work in a MNC and as i was going through the C++ learning material, i came across the following inheritance program which i am really not able...
[no replies]
Switches Gone Wild
 
I was reading through the source of boost::asio just a few moments ago when I stumbled across a piece of code that almost made my eye-balls pop out... ...
[3 replies] Last: I don't think that code was meant to be read by anyone :s (by shacktar)
Time Analysis of C++ functions
 
I am having trouble with this function Please help the following questions... Show (a) the exact number of operations and (b) the Big-O estimate of the followi...
[2 replies] Last: int x=1, y=x--, z=--y+x; Looks like someone has a sense of humor.... (by helios)
XRandR on Ubuntu
 
I'm trying to link SFML statically on Ubuntu, and as such I need to link to all of it's dependencies. I'm getting "undefined reference" errors on things prefixe...
[2 replies] Last: Thanks - it was Xrandr . PS: Sorry, I forgot to mention that I'm usi... (by anonymous23323124)
Color c++
 
I'm making this bouncing ball in c++ and SDL, but I want the .png ball to gradually change color, is there a code that makes me able to do that?
[2 replies] Last: The best thing you can do is have code that creates the properly-color... (by Duthomhas)
help
 
I would like you to help me writing a small program that initializes the name weight and sex of 4 persons the program mst display them on screen using structu...
[3 replies] Last: If you are an absolute beginner, try the tutorial on this site: http:/... (by anonymous23323124)
Linked list of different classes
 
I need some way to declare a linked list (or vector) where each element may be of any class. Unfortunately this seems to be impossible with the standart contai...
[no replies]
by Miss k
C++ Access Violation Exception?
 
Hi all I am getting an access violation expection error in the function code below though everything has been intilaized proporely. struct queue { ...
[4 replies] Last: It turned out that the linked list was not intialized properly The ma... (by Miss k)
Empty abstract base class
 
Is it possible to declare an empty class (without any member functions or variables) ? I need it to make a linked list containing different classes. Any b...
[1 reply] : Is it possible to declare an empty class (without any member function... (by Athar)
using if +break, new post
 
Thanks in advance, and sorry for post it again just to make it clear for the us but I need to do the same code in both if statement guys, and I need the pr...
[2 replies] Last: exactly !condition2 but how do u fit the for loop and if together bcz ... (by john1984)
using break !!
 
Hi guys I want ur help in this plz, I want when the first if gives true, do the statements and break(do not go the else if). and if the 1st if gives false go a...
[10 replies] Last: Thanks ne555 for the reply but I need to do the same code in both if ... (by john1984)
Relational Operator Overloading
 
I want to overload the relational operators (<, >, <=, >=) as member functions but I can't seem to get it to work. I'm not sure how to access the calling member...
[8 replies] Last: @andywestken Well spotted, absolutely right. Needs to be const. @d... (by Galik)
search and replace string
 
Greetings, Please help!!! I have a load of csv files which I need to format and create a pdf. This is what I have been doing. 1. Opening the csv into exce...
[1 reply] : bump Please, if you review this and have no solution, please reply wi... (by indepthcomputer)
by Zeeb
Adding and comparing with a vector also whole numbers
 
What i want the program to do is.. 3/2 = Add 3 to a vector since dividing it by 2 gives an uneven number. 4/2 = Discard 4 since 2 is an whole number. 5/2 =...
[5 replies] Last: You need to use another loop rather than a long line of tests. Before... (by andywestken)
Increasing The Number of Decimal Places in C/C++ whit GMP
 
Could anyone help me? I need to make some calculations using a precision very high, then I installed the Library "GMP 5.0.2" using the WebUpdade of "Dev-C++...
[no replies]
Storing simple Information structures on harddisk
 
Hey fellows, to gain my first experiences with c++ I decided to implement a simple vocabulary trainer. I like to emphasize simple, because I don't want to u...
[2 replies] Last: As you're storing strings anyway, the delimited txt file approach is p... (by andywestken)
August 2011 Pages: 12345... 29
  Archived months: [jul2011] [sep2011]

This is an archived page. To post a new message, go to the current page.