Beginners - January 2014 (Page 34)

by aju33
Help with if..else if else loop
 
Hi Everyone, I am attempting to write a program on my own, using the If...Else If Else Loop. I would like the program to read the user input of a score to be ...
[6 replies] Last: Thank you Chervil and Smac89! I made the changes suggested by Smac89,... (by aju33)
Constructor in a base class, what exactly does this syntax mean?
 
Thanks for looking over this snipit of code I can't figure this out, on line ten is the constructor for the Fish class and it takes a bool as a parameter, my qu...
[5 replies] Last: Hey thanks a lot mate, that little part has been troubling me for a go... (by ragecoder)
by Aceix
C++11 lambdas
 
Hi all, Is there any advantage of C++11 lambdas over the normal functions? And am I advised to use lambdas anytime I want instead of functions(except in str...
[3 replies] Last: Is there any advantage of C++11 lambdas over the normal functions? I... (by Cubbi)
Nearest integer function
 
I know it's a basic question, but, can you please tell me how can I take the nearest integer of a floating variable? For example, if C=1.25, I want to take Cint...
[10 replies] Last: #include <iostream> #include <cmath> // for std::lround() #include <i... (by JLBorges)
by alsade
tryin to learn how to work with txt files..
 
i have two questions: 1) why does the line cout<<line<<endl; in the end of the file doesnt print anything on the screen? 2)lets say i want the string line t...
[5 replies] Last: 1) why does the line cout<<line<<endl; in the end of the file doesnt ... (by Chervil)
by dero
Subtraction and storing decimal numbers in an array
 
hey all I am trying to perform a subtraction operation on two decimal numbers declared as double in a file. The result of each of these two numbers should be ...
[15 replies] Last: No need to apologise, your questions are ok. First, your program code... (by Chervil)
Why using pointers ?
 
Hey guys , so I've been learning c++ for a while now , and since I just finished finals , I tried to review what I took and then learn more , the problem is , t...
[7 replies] Last: Thanks guys , I think i'll stick with learning new things for now , an... (by Cutefriendzoned)
How many space should be reserved for dynamic class with placement new
 
with placement new, it turned out that sizeof operator can't tell me the real space needed to set an array (buffer) to hold two successive class object. i se...
[2 replies] Last: why? the problem is the pointer arithmetic holder + sizeof(goodday)... (by coder777)
by wolfv
When Makefile target name is directory name
 
Apparently using a target name that is also a directory name means something special to Make. Please explain the significance of a target name that is a direct...
[2 replies] Last: Thanks code777. Sorry I didn't make the question clear. The following... (by wolfv)
by enemy
Sort an array by iteration
 
Hello! Pleas,e can someone tell me, without any program code, what would be the IDEA(pseudocode) of sorting an array's elements form minimal to maximal using I...
[2 replies] Last: @OP You could check the <algorithm> standard header. They've got some... (by Aceix)
Problem about function stoi() for convert a string
 
Hi, I have a problem with the following lines of code friend ifstream& operator>>( ifstream& input, Publicazioni& obj) { std::string::size_type sz; ...
[1 reply] : it's a C++11 function, try compiling w/ -std=c++11 or possibly -std... (by nvrmnd)
Problem with TIC Tac Toe (First real program)
 
I've been trying to figure out how to implement the function that checks if the space is valid. So that an X cannot replace an O. I've got some of the code star...
[1 reply] : > so anything else you can suggest would be great. Attempt this after... (by JLBorges)
Code Error in *Nix Enviroment (Basic)
 
Hello, I know that the bellow code wont work as intended in a *Nix Enviroment. Also i am unable to identify what is the problem with it, so because of that ...
[5 replies] Last: Yes indeed It will work with one digit values. I noticed a bit later t... (by horance89)
Julian Date - help with ifs, elses, and more
 
Hello! I've improved my C++ skills since my last topic, could you please help me? #include <stdio.h> #include <stdlib.h> int main () { int JD, ...
[7 replies] Last: just out of curiosity how have you been learning (by Cronnoc)
output problem
 
I am almost done programming bisection method. My program runs and displays correct results but it displays it badly.. please help me fix it.. i want the follow...
[no replies]
String Complier Error
 
c++ members, I have run into a complier error on line " name . The complier error says "no suitable constructor exists to convert from "size_t" to "std::basicst...
[1 reply] : std::string::find() returns a std::size_t . Your function expects ... (by xismn)
String Position Guidance
 
I have this following code from the c++ reference page. In this code, I have str.assign(base,10,9) I have three parameters with second parameter(10) being the...
[2 replies] Last: got it thank you! :) (by fahmankhan75)
Scanning a floating variable
 
I've made a very silly testing program, because for some reason I can't conclude this most simple operation. Despite the value I assign to t, it's always retu...
[11 replies] Last: @mutexe: That's a windows extension. There's no scanf_s in the C libra... (by S G H)
C++ Vending Machine Program
 
Thank you, changing the assignment operator worked but I am still having an issue. I thought something was wrong with my exit condition for my if statements tha...
[5 replies] Last: Thank you for the advice. I changed the bool to an integer and changed... (by stewartjc1)
Function parameter question
 
I was doing some more tutorials and i found this function declaration (inside of a class): void render( int x, int y, SDL_Rect* clip = NULL, double angl...
[2 replies] Last: Read that page and somehow managed to miss that part, exactly answers ... (by Penanito)
January 2014 Pages: 1... 3233343536... 44
  Archived months: [dec2013] [feb2014]

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