Beginners - February 2015 (Page 30)

Converting one character into another
 
Hello Guys I want to convert one character into another e.g. array has 10 characters like abcdefghij now I want to change all the a's in array into z'...
[1 reply] : Loop over all characters in your array check and replace them for(int ... (by MiiNiPaa)
by Nanyo
check if file is open and ask for password
 
Hi I am trying to make a program that asks for password when you try to open a file. Any Ideas? Thanks in advance! I tried with that, obviously without succe...
[no replies]
Check my progs
 
Hey, I am a beginner, check my prog #include <iostream> using namespace std; class car { private: int wheel, sets, gairlever, g...
[no replies]
Question
 
Hi; Plz tell me, why we use . operator when we are using classes ? Like Here: In this line: factor = gcf(numerator, second.numerator); Fraction::...
[13 replies] Last: const after a function declaration means that the function is not allo... (by BillyBob)
Const keyword
 
Hi, Some times why we use const keyword at last, Like as: Fraction operator+( const Fraction &second ) const;
[4 replies] Last: void g() const When you create member function, aside from arguments... (by MiiNiPaa)
Temp conversion program
 
Hi, I want to write a program which asks me to enter temperature with unit, like 32F and then converts it to C, and if it's 100C then converts it to F. But ...
[1 reply] : int temp; char scale; if(std::cin >> temp >> scale) { std::cout <... (by LB)
Error with vectors, switch statement, dataFile
 
When compiling my code case 2 results in me getting an error but if i comment case 2 out my code works fine. I am confused what i did wrong. my newdata.tex...
[1 reply] : You blindly access values in a vector without making sure those values... (by LB)
by kiri
add a mathematical calculation in a dat file w ifstream
 
Would it be possible to pull data from the data file and include a mathematical calculation on one/all the lines? Data file Line 1 Joe 99 25 ...
[1 reply] : Yes. (by LB)
Exception Handler Crashes
 
I am trying to add an exception handler for Dividing by zero, however if the if is TRUE, it crashes the program. any help would be appreciated Here is the sn...
[6 replies] Last: Well, if you throw inside the try like that , then it's pretty pointl... (by LB)
Clear to me
 
Please explain what this code will do, why we use it and where we can apply it ? Thanks. #include <stdlib.h> #include <math.h> #include <iostream.h> //...
[16 replies] Last: Thanks :) (by BillyBob)
PLEASE HELP
 
I have a project due at midnight tonight that I cannot figure out. I need to write a program that will calculate a user's salary if their pay starts at a penny ...
[8 replies] Last: Damn trolls. (by Mr D)
by Lande
How does a report work
 
I'm teaching myself c++, so i'm very new to this. I have been using a rich edit to display text that is only inserted through code. I need this generated te...
[no replies]
by Aideux
Need help identifying smallest and largest numbers
 
So I have just started working with C++ this semester, so I'm fairly new to working with all of the concepts. Our most recent assignment asks us to output the s...
[5 replies] Last: Ahh ok. Thank you. Sorry about that, I'm pretty impulsive. I really ap... (by Aideux)
by kiri
Whats wrong with this code?
 
Anyone? #include <iostream> #include <fstream> #include <string> using namespace std; int main () { ifstream inputFile; string name; inputFi...
[6 replies] Last: lol, Thank you (by kiri)
Having issue
 
How do I input file string seperated by commas and print. The string needs to stop after each comma. Having trouble trying to figure out the correct method. Thi...
[1 reply] : Use the third argument of std::getline : std::string blah; std::getl... (by LB)
by tbrady
Issues with fabs pow and sqrt functions
 
I've been writing code for my computer science class and whenever I use the functions fabs, pow, or sqrt in my code it gives me the error "'void*' is not a po...
[1 reply] : Please post a minimal example (10 lines or less complete program) that... (by LB)
Reformat output txt file every 6 commas
 
I am trying to make a code which takes unformatted data from a .txt file and re-formats it into a new txt file. In particular, I'd like to make a new line ever...
[5 replies] Last: Thank you very much Obscure. I am not exactly sure why mine was givi... (by Tbone413)
Lost on the Math, makes code writting harder
 
Hey I'm totally lost on the math behind this problem I'm trying to figure out. The problem says to write a program to compute an area between y = sin(x) and y ...
[4 replies] Last: Thank you so much. My girlfriend somehow understood what you guys were... (by ProgrammingIgnorant)
operator overloading : unary operators
 
use the following rules of thumb to decide: If it is a unary operator, implement it as a member function. Why can't we make global friend / non-friend functi...
[3 replies] Last: Hm, I don't know the answer. The long conversation in the comments doe... (by LB)
by aver97
C++ Reading a file and it's individual characters to output to a table in the console
 
I have a project due tomorrow that I've been working on for a while and I'm just plain stumped. This is exactly what's required of me: Perform a few activiti...
[1 reply] : You have some issues. You should be reading the input file character-... (by Texan40)
February 2015 Pages: 1... 2829303132... 52
  Archived months: [jan2015] [mar2015]

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