Beginners - January 2015 (Page 14)

Output of ofstream
 
I was learning how to save output of C++ file to .dat file. I followed the following example. But where is the output file saved? #include <iostream> #in...
[2 replies] Last: for me it saves it in the directory where my project files are saved. (by rafae11)
by beko
std::transform, std::back_inserter(), std::string
 
#include <iostream> #include <vector> #include <iterator> #include <algorithm> #include <string> std::string concatter(std::string s1) { return s1;...
[5 replies] Last: Ah, now I understand. Thanks a lot. (by beko)
by sha92
Error in subclass!!
 
Help!!! This code doesn't work and I don't see the error! What should I change to make this work???? #include <iostream> using namespace std; class Re...
[9 replies] Last: http://stackoverflow.com/questions/10282787/calling-the-base-class-con... (by mutexe)
2d array print line numbers of char
 
Input: 1; ; ; ;1; ; ; ;1; ; ; ; Ouput: 1=2=3= = = = = = = = = = How to print the linenumber of the '1' on one line so the in...
[7 replies] Last: Why do you have a triple nested loop on the input? You only have 2D da... (by keskiverto)
Hi,i need help with c++ TASK
 
Hi i need to make program but dont know how i am using wxDev-c++ and i need to make. Tasks would include: use a class or struct variable, and create a progr...
[1 reply] : Hi, first of all the text of the exercise does not say anything about ... (by minomic)
Exercise attempt bugs, please help!!!
 
So I have learned a few things about c++ in the past week and have decided to try an exercise with what I've learned and make a number guessing game. At time...
[10 replies] Last: This is almost the same as mutexe's version: #include <iostream> int... (by keskiverto)
Ar yra lietuvių ? :D
 
Any lithuanians here ?? :D
[no replies]
by mazior
Timed mouse clicks
 
Hey, i have been trying to create a function that accepts mouse clicks within 10secs and if the clicks are less than 20, cout's "click faster loser or something...
[no replies]
Array problem
 
Hey guys. I've got some problems. Can anyone tell me how can I solve this problem. I need to write a function that gets an array as a parameter and returns the ...
[3 replies] Last: Thanks I did it myself. :D (by The suffocated)
Formatting Output (setw or right justify)
 
All I want to do is format the output to where everything is lined up. I have a program that calculates monthly payments for a loan in one function, and disp...
[1 reply] : This: cout << setw(13) << "$" << newBalance; Is same as this: cout ... (by keskiverto)
by MTorp
Architecture of a c++ program
 
Hello everyone. I'm a fairly experinced java programmer, but to broaden my knowledge of programming in general i recently decided to learn c++ (or atleast to...
[5 replies] Last: You might want to read through the FAQ about file types and purposes ... (by MTorp)
Why doesn't the loop work?
 
I am trying to figure out data structures right now, so I decided to create a testrun program to try struct out. The problem is, I want this program to loop ove...
[1 reply] : http://stackoverflow.com/a/21567292 (by MiiNiPaa)
by vmohan
Setting a text color gloabally
 
I wanted to know if there is a way to set a textcolor globally, like for all console output for a program, i'd like to have the same color. I tried just using ...
[2 replies] Last: that statement doesn't seem to work on turboc++ right now, the problem... (by vmohan)
Star Pattern with 1,3,7,15,31,63 sequence logic.
 
Hi, I am stuck on this program: Write a program to print following output: * *** ******* *************** ******************************* ************...
[3 replies] Last: GOT IT! #include<iostream> #include<conio.h> #include<stdio.h> void... (by SobanSA)
Does removal to a deque object invalidate its iterators?
 
I read from my textbook that all iterators of a deque object should be invalidated if an element is removed from places that not the front or back of the deque ...
[2 replies] Last: Thanks for the clarification. I appreciate it! (by glenjoker)
by Jweim
Reading from File into 2D array issue
 
I'm attempting to read from an already created file that is 5 x 5 into a 2D array. In my program I've tried both an eof() method and a boolean way to determine ...
[4 replies] Last: You don't need to pass your constants into the function if you just de... (by HatchetMan302)
by vmohan
Password input
 
I've been trying to make a program which involves checking if two inputted passwords match. However, it seems as though my program always says that the password...
[3 replies] Last: just use std::string (by anup30)
C++ graphics engine for beginners
 
Hello. I have been assigned to create a game for my C++ class. It can be a text based game, but I would like to try and use a graphics engine to try and create ...
[2 replies] Last: Thank you! (by Lbkulinski)
Can I make global variables const in some functions?
 
Suppose I have some variables that are changed only in a couple of functions, but which need to be accessed in a bunch of other functions. One way is to pass...
[6 replies] Last: you can use static variable/function in class. keep the variable priva... (by anup30)
Need help with spacing
 
I have a program that prints out pascal's triangle. One problem: it isn't a triangle. The output doesn't work. This is what it should print: How many rows: ...
[1 reply] : 1st cout: cout<<" "; 2nd cout: cout<<" "<<coef; 3rd cout: ... (by YodaCode)
January 2015 Pages: 1... 1213141516... 39
  Archived months: [dec2014] [feb2015]

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