General C++ Programming - February 2011 (Page 11)

by zeos
program compiled but url not execute !!!
 
url = "http://host.host.com" + folder + "?server=" + server + "&code=" + code ; connectionP = eHTTPConnection::doRequest(url.c_str(), eApp, &error); pro...
[8 replies] Last: thanks moorecm !!! i confirm that is e dreambox plugin running in e... (by zeos)
by p0711
bubble sort
 
const int size = 5; int main() { int i, j, a, tmp = 0; int table ; for(i=0; i <size; i++) { cout << "enter num: "; cin >> table ; } ...
[4 replies] Last: ok its works! thank you! :) (by p0711)
for(int i=0;i<x;i++) is recomended?
 
Hello guys! I'm on Linux using GCC and i want know if is correct declare the variable inside the for hearder like it: for(int i=0;i<x;i++){ printf("%...
[10 replies] Last: It would be part of the language definition, not an optional thing. b... (by rocketboy9000)
Whats the problem here
 
#include <iostream> #include <cmath> using namespace std; class triangle { public: triangle(int opp, int adj); double area() const; double hypotnuse...
[2 replies] Last: At the line triangle(input, input2); you construct unnamed object. I... (by simeonz)
Static
 
Hi All, In C, when we declare a function as static, we can see it only in the same .c file. The same goes in CPP. But when we declare a static function in...
[3 replies] Last: what exactly is the difference between a static function and a static... (by simeonz)
issue in smart pointer class - C++ Unleashed Book - why is destructor called
 
I was testing the smart pointer code from Jesse Liberty's book C++ Unleashed and noticed in testing it did not work, so I am trying to fix it. The problem was i...
[2 replies] Last: thank you for your help, it is much appreciated it has been years s... (by closed account yTkN8vqX)
by bzz77
Using streams in C++ to read in numbers from a file.
 
I know how to read in a whole file, but how do you get only parts of a file? If I have: getline( ss, line, '\'' ); getline(ss, line, '\''); istringst...
[8 replies] Last: hamsterman, thanks again. I would not have figured this out and I'm v... (by bzz77)
ifstream Issue
 
Hi i'm having a problem using ifstream. I'm reading from a .dat file which contains 1's and 0's but nothing seems to be coming from the stream, my code is below...
[4 replies] Last: Is the data file an ascii file or a binary file? If it's binary, you ... (by doug4)
Please Review My Coding Style (1,2)
 
I've seen users of this forum posting a C++ source file containing their coding style. So I thought I would have a go :) Rating System 1 asterisk( * ): Po...
[35 replies] Last: @rocketboy9000: take a look at jsmith's coding style. All of the comm... (by PanGalactic)
Is there a way to minimize the flashiness of upating the console screen?
 
When you have something colored printed to the console that prints again, quickly especially, the flashiness of the update tends to be an eyestrain. Is there a ...
[2 replies] Last: Or use an actual graphics library to put up smooth graphics at the spe... (by rocketboy9000)
setting up sfml
 
This is my second failed attempt at making an SFML application, this time in VS2010. I've included the headers and linked to the libraries which I think wor...
[11 replies] Last: when I delete all the .lib and .dll files then rebuild it only produc... (by Disch)
I need some struct guidance
 
Okay I'm new to structs and this is my first program dealing with them. I'm lost on the part where I get the user to enter the information and I need some hel...
[3 replies] Last: It should return a boolean; so you would change the return value to bo... (by pabloist)
by Shaddy
Zum drĂ¼berschauen
 
Hallo zusammen, next time i will have my exames, now i wanna show you my binaer- hexa-calculator, to check it for me please. It should be correct, easy to u...
[3 replies] Last: Note that the only difference between dex2bin and dec2hex is the opera... (by ne555)
GCC, MSVC, static integral constants
 
I've just stumbled into this issue. Stroustrup's "The C++ Programming Language", says (p. 249): "If (and only if) you use an initialized member in a way that r...
[12 replies] Last: Well all I meant was that if you chose to do 'int x = A::M;' in your c... (by chisholm)
C++ - Overloading <<
 
Hi All, I have a problem whilst over-loading the << operator - I am developing in Visual Studio 2008. I have drop down boxes - lets call these 1,2,3. Now i...
[no replies]
by pidus
Different outputs from g++ and vc++
 
The following code behaves differently when compiled with g++ and with VC++ (in VS 2008): int main(int argc, char *argv ) { ifstream infile; char *str...
[11 replies] Last: undefined. (by closed account z05DSL3A)
highscore sorting
 
So i am making a highscore program, so i need ur thought about the sorting this is my plan: When we get a new score, we start for the top of the score and wh...
[5 replies] Last: oh when u said dichotomy i thought u meant something else, but i see n... (by M364M4Ncro)
question about Predicate
 
I have a code as following: #include <iostream> #include <algorithm> #include <list> using namespace std; //the class Nth is a predicates class Nth{ ...
[2 replies] Last: The typical pattern for saving state is to use references: struc... (by jsmith)
replicate ostream (operator<<) ?
 
Hi, I apologise if I have placed this in the wrong section of the forum, it is my first post. I wrote the following simple class to stream the output either t...
[3 replies] Last: Yes - you're right. I didn't look closely at your operator<< declarat... (by jsmith)
Accessing (partially) overloaded function
 
Consider the code: class Base { // Declares two versions of foo public: void foo (void) {} public: void foo (int i) {} }; class Der...
[3 replies] Last: Thanks. The using Base::foo; is cool :) (by krishnendu)
February 2011 Pages: 1... 910111213... 25
  Archived months: [jan2011] [mar2011]

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