Beginners - January 2014 (Page 36)

use of ios::trunc
 
hi, i researched but couldnt find a definite answer to this: as far as i know when using ofstream to open a file for writing, all pre-existing contents get dele...
[2 replies] Last: thank you (by ardengo)
Start with FLTK
 
I'm new with FLTK and I'm following the book "Programming-principles and practice using c++". I have done all the steps in D3 and D4, except for D4.4 because my...
[1 reply] : mmmm, AFAIK. that means you created the project as a GUI or Win32 G... (by nvrmnd)
Stroustrup chapter 2 Draw()??
 
In the exercises at the end of chapter 12 the exercises call for drawing various shapes. There's nothing in the text of chapter 12 which discusses using draw()...
[11 replies] Last: Nullinfinity....it only seems hard at first. Try this: http://www.tech... (by plasmanoid309)
persons name while loop
 
the name can consist of letters spces a single quotation mark and a single hyphen. if there is a illegal character the program will ask to re enter name. onl...
[3 replies] Last: Well those comparisons look mighty dodgy, but I think your problem is ... (by tipaye)
String error
 
In the following code, I'm trying to figure out if the first letter of the string is vowel or not. So in my function, I'm using an if statement; however the pig...
[2 replies] Last: http://www.cplusplus.com/reference/string/string/find_first_of/ (by mobotus)
by alsade
const member implementation question
 
I have a class Pop3Adaptor with this decleration in the header file: class Pop3Adaptor { public: const char* User(const char* userId); }; how woul...
[4 replies] Last: You probably want to initialise it in the constructor. Take note of C... (by MrHutch)
by Ch1156
Can i initialize my variables in the constructor?
 
I have been initializing my variables in main, but i was wondering if i could initialize them in the constructor, is there a reason i would choose one way over ...
[18 replies] Last: bump. (by Ch1156)
Vector
 
Please can someone explain this code. I got it from the programming practice and principles book. #include <iostream> #include <string> #include <vector> ...
[10 replies] Last: Ok. Let me learn arrays. Thanks. (by closed account iAk3T05o)
lazyfoo SDL: Confused about how this SDL_Rect array is getting used in this animation.
 
http://lazyfoo.net/tutorials/SDL/index.php After about tutorial 10 or so he stops linking to pages describing his tutorials (because he hasn't completed his tu...
[2 replies] Last: Thanks Lumpkin! (by NullInfinity)
by aspic
Screen Problem
 
Im having a problem when i compiled my code..the code works but when i compiled it the screen only pops out / SDL screen only pop's up and immediately close.. i...
[1 reply] : Well your program is working perfectly fine, in that it's not actually... (by yulingo)
warning C4554: '&' : check operator precedence for possible error; use parentheses to clarify precedence
 
I keep getting the error warning C4554: '&' : check operator precedence for possible error; use parentheses to clarify precedence when I try to run my program,...
[6 replies] Last: Thank you very much guys, when I called the function at the beginning ... (by sailorman444)
by alsade
Problem with implementation..
 
if i declare a member function in the header file like this: const char* User(const char* userId); whats the syntax for declaring it in the *.cpp file? ...
[1 reply] : It's just like how you would declare it if it were all in one file. c... (by long double main)
Input validation
 
So far I have been using while loops and do while loops for input validation. This is good for simple programs, but if I put in characters when I need a int or ...
[9 replies] Last: long double main thank you for the response. (by alee4408)
by Hergie
monsterHP
 
Hi folk! I recently started learning c++ and i love it! It's a great language. However, i'm having a problem with this little game i wrote. Instead of run...
[7 replies] Last: Thanks a lot guys! My code works fine now. I learned a ton from this t... (by Hergie)
by JohnJH
inherit from classes..
 
as far as i've understood, inheritance make it posible to inherit member from a class to a new class.. i've also heard something about specific inheritance due...
[1 reply] : A child class has all the parts and members of its parents. Always. ... (by Disch)
by JohnJH
Overload operator
 
I need to overload this operator for my class Car.. It should compare each attribute for the object, and cout the things which are the same. ex. ...
[7 replies] Last: It's generally how you overload an operator i am confused.. Using my... (by JohnJH)
Using function to store prime number vectors.
 
I was attempting to store prime numbers in vectors while using a counter. This code does nothing though. Is there a way to do this with the tools I'm doing? Wa...
[1 reply] : Each time prime is called, the previous result is lost, so you will o... (by tipaye)
void functions error
 
can anyone help me with the error in this...i cant seem to find it #include<iostream> using namespace std; void trapezoid(int, int); int main() { ...
[2 replies] Last: thnx @yanson (by htrules1)
credit card details
 
Hi everyone, im trying to put in a 16 digit credit card with space or "-" after each 4 digits. the code works fine if I put in a correct 16 digit code... but if...
[5 replies] Last: thanks giblet I was maybe abit hasty in thinking it was done last week... (by chris7daly)
why it still work when i initialize variables in the class declaration?
 
I know that there are only two kind of types can be initialized in the class declaration, which are enum type and static const interger type. But when I initial...
[2 replies] Last: Perhaps show the code in question? (by tipaye)
January 2014 Pages: 1... 3435363738... 44
  Archived months: [dec2013] [feb2014]

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