Beginners - December 2013 (Page 9)

by dero
Reading a specific range in a file
 
hey all I am trying to read a specific range in a file and perform on it a certain calculation. I tried to specify the range using if condition if (b > 0 &&...
[no replies]
by mmai
Palindrome words
 
Hi! I need help with this program :) the user has to input some words but firstly give the number of the words he is going to give (N) . After the program has ...
[2 replies] Last: A) what's up with your naming style? B) why are you including <string>... (by closed account Dy7SLyTq)
using fstream
 
Create a class Employee with name, Id and salary as data members. Provide appropriate constructors, set, get and display methods in the class. In the main pro...
[13 replies] Last: and how can i return the whole array instead of single character i did... (by Sharan123)
Project Euler p#14
 
NOTE: Please don't post the correct answer. Hi I am solving Problem 14 of project euler. http://projecteuler.net/problem=14. I wrote a program for it and get t...
[2 replies] Last: Ah thanks it worked ^_^. (by Stormboy)
by klay2
text based graphics wont work
 
this keeps outputting random characters #include<iostream> using namespace std; int main() { int map = {1}; int countx = 5; int county = 5; while(cou...
[17 replies] Last: I have done this before but it's not working now so I did at one point... (by klay2)
output scanf's input to function
 
I want to output scanf's input to function. Not sure if this is possible but couldn't find at google my answer. #include <stdio.h> void main() { print...
[1 reply] : That won't be possible because scanf takes in input and puts it in the... (by Stormboy)
pass arguments to constructor from pointer object
 
hello, I've been playing around with some examples from a tutorial I'm using to learn c++, and so I made a simple class, dog, that has a constructor looking fo...
[2 replies] Last: thank you very much! (by geniusberry)
by mmai
where is the mistake..?
 
i'm trying to do a program where the user will give some numbers and the program will find the number that its half and its double are included in the numbers t...
[11 replies] Last: Thank you so much for your help :)) (by mmai)
difference between write and using insertion operator
 
If you want to write to a file you do this //method 1 ofstream offile("DATA.txt"); offile<<"This is the first method\n"; //method 2 ofstream off...
[9 replies] Last: Did you try something like this: #include <iostream> #include <fstrea... (by Chervil)
Calling functions from class (E2294)
 
Hi, I am learning C++ and can't understand what I am doing here wrong, I know that my class is like a function because i have used constructor but don't know ho...
[2 replies] Last: I can't create new object without this parentheses because I used my o... (by mario0001)
RE: C++ Tic Tac Toe
 
I am a bit confused as to why my program won't execute. It runs the code and immediately terminates. Also, for my void printboard function, is there a way to re...
[3 replies] Last: yes, both of your codes make sense, but i am unsure why my code does n... (by jeffreyz)
sin cos calculations, high precision library
 
hello --I have not been able to find the answer as to how the sin and cos functions are calculated in math.h, is this done with the taylor series? or is it so...
[6 replies] Last: thank you all very for the fast answers. I first of all need c++ to pr... (by vilbjorg)
I keep getting this errror message: error: expected unqualified-id before 'switch'
 
Hi! I wanted to create a programm with the switch function in it, so i made a code, where you can type the date and you get a nice sentence like i whish you a ...
[6 replies] Last: Thank you so much, now does it work! It was the second code i tried t... (by Ichmagkekse)
Airplane Seating Program
 
Program Objective: The program is supposet to ask the user of what type of class (business, economy, first class) they want. In my program there are certain row...
[1 reply] : Line 71 - display_program not defined. Line 74 - airplane_seats not ... (by AbstractionAnon)
Switch Structure Error-do while
 
Problem: In my switch structure inside the following function, the switch structure works perfectly when and IF I enter in the correct cases (a,b,c) for the fir...
[3 replies] Last: I got it solved guys! forgot to set my flag=false inside my do while l... (by fahmankhan75)
Confusion with this site's tutorial on "explicit" typecasting
 
I am studying the tutorial on this website, for explicit keyword for typecasting http://www.cplusplus.com/doc/tutorial/typecasting/ It is quoted: Additi...
[3 replies] Last: mistake of forum ? (by tudonghoadanang)
Need help with loop
 
Hi everyone, I'm an absolute beginner here and I'm trying to learn C++ by myself through videos on youtube and other online resources. Here's a small program I...
[6 replies] Last: Thank you so much for your clear illustration CaptainBlastXD and Chris... (by hympert)
I need your help! Do While
 
I want my program to loop until the user enters 0 (for selection). Like in some way, I want to keep my program running until 0 is entered...resulting in the clo...
[4 replies] Last: A char contains one letter, and one letter only. There are also two di... (by TwilightSpectre)
Enumerated type variable
 
#include <iostream> using namespace std; int main() { enum numSet {zero, one, two, three}; numSet numA = one; cout << "numA = " << (numA) << endl;...
[3 replies] Last: Enums are meant to be integral constants. If you just want a useful co... (by IceThatJaw)
3n+1 problem
 
this is the link for the problem " http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=36 " this is my ...
[1 reply] : calc is an int function. When you call calc recursively, what happens... (by AbstractionAnon)
December 2013 Pages: 1... 7891011... 69
  Archived months: [nov2013] [jan2014]

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