Beginners - February 2016 (Page 41)

putting stuff in map in global scope
 
Hi, I cant really understand what this error message means when I'm doing this : #include <map> #include <string> std::map<std::string, int> mp; mp["tr...
[2 replies] Last: Thank you very much man! (by etrusks)
by cbar
type casting/type conversion not working
 
Hey guys, have to write a beginner's program( I realize there are more efficient ways to perform some things, but have to keep it simple for this assignment). ...
[1 reply] : By default it only shows decimals if it affects the value. If all deci... (by Peter87)
by Ansev
vector <bitset <6> > to stringstream
 
G'day I'm trying to write an AIS decoder (NMEA 0183) as a project while i learn C++ and have become stuck trying to get a vector containing binary to a strings...
[4 replies] Last: Took me a few minutes to realise that the error getting thrown was bec... (by Ansev)
Help Needed!: Classes/Methods
 
Hey guys. So I am currently learning C++ from a book called "SAMS Teach Yourself C++ in 24 Hours!" and I was following some instructions on classes and methods....
[2 replies] Last: "SAMS Teach Yourself C++ in 24 Hours!" I havent heard of this book, ... (by TarikNeaj)
how we can find the output on copy
 
i want to find the output of this code on copy but while i am doing i am unable to find and also i am using watch function but for this code that is also not wo...
[5 replies] Last: Thanks (by arunrd2015)
Help to my first program
 
Forgive me as I am currently in the process of learning programming. This is my 3rd day studying and I designed a simple program. It prompts a individual to gro...
[10 replies] Last: I was worried on using double variables due to working with money. ... (by TheIdeasMan)
How to input a file when I do not know the name
 
I know how to read in text files when I know the name ("input.txt", etc.) and in the past when I did not know the name I would prompt the user to input it. But ...
[4 replies] Last: TarikNeaj + 1 Ask your teacher for clarification. A good way to put ... (by Duthomhas)
by skhjr
text alignment
 
can someone tell me how i can fix my text alignment for test scores and grade? i want them in a column, but they are all out of line. This is how my output te...
[3 replies] Last: Everything you print must have a specified width. You are not printing... (by Duthomhas)
by ieesab
use of while loop
 
i am very beginner in c++ and trying to do exercises, here i used while loop, my code is working but i want to know can it be written in a better way. ...
[4 replies] Last: Thanks for your precious suggestions and valuable help. (by ieesab)
const char
 
I'm trying to make a whitelist sort of thing, just a very simple one with cin and stuff. However, to check if the people are on the whitelist I do this: ...
[4 replies] Last: ^ /s/vector<const char*>/vector<string>/ (by Duthomhas)
How do I detect the reason for an stream fail state?
 
I'm taking Intro to Programming. Today we learned about using fstream to read/write to the filesystem. The teacher mentioned "fail states", saying they can happ...
[2 replies] Last: Stream failure can happen for a lot of reasons, but C++ isn't interest... (by Duthomhas)
by animus
C++ Function call isn't recognized? (Array to Stack implementation)
 
Hey, so I seem to need a lot of help when it comes to C++. The purpose of this homework is to create a 1-dimensional array implementation for a Stack. First it ...
[18 replies] Last: ¿why do you have so much whitespace? int *array; //these should c... (by ne555)
Erasing a string array
 
I'm reversing C-string inputs, which I got working fine. My problem is when I try to apply the code to a while loop to enter new inputs. The new inputs keep add...
[5 replies] Last: Thanks!! (by jibicax)
I need a while loop that calculates the min, max and average of n numbers.
 
Write your question here. Basically the user is told "Enter N" Then my program will allow the user to enter the following N integers, one at a time. After the ...
[2 replies] Last: Here is your while loop and a little more: #include <iostream> #incl... (by Thomas1965)
Vector/Array question
 
Hi! I have a question about vectors. I am lead to believe that vectors can be resized/added to etc 'on the fly' What I mean is when you use an array you have t...
[7 replies] Last: Although the std::array<> doesn't have a fill constructor you can stil... (by jlb)
by kmce
Learning headers and .cpp
 
This question might be slightly difficult to explain but i will try my best. I am learning to place different parts of code into header files and .cpp files. I ...
[11 replies] Last: Look at it from the compilers point of view: When you call the attack(... (by edge6768)
how to access var of another .cpp file
 
I want to create a few big arrays filled with variables, to make sure, that my main.cpp file is easy to overview I want to create/define/declare these variables...
[5 replies] Last: Is it also possible to initial a 2 dimensional vector Yes. and acc... (by jlb)
First project
 
Hello, I am currently working on my first project which has us code a formula to predict the amount of money a person will save by investing in a retirement acc...
[3 replies] Last: Heres the code. Most of the values I rely on the user input but the te... (by mcanepa6787)
by skhjr
How to make an output file / text alignment
 
Can someone tell me how to output data to a output text file? I know I am missing the outfile << whatever << statement but I cannot figure out how to get outfil...
[3 replies] Last: but my professor wanted us to make the file variables global. That... (by Thomas1965)
structure help
 
Hello all Could anyone tell me what the ": 1" is doing in this instance? I haven't managed to find it anywhere on here so far. Thanks struct st...
[1 reply] : ignore this. I have found something. my understanding if I have mu... (by wilk3sy)
February 2016 Pages: 1... 3940414243... 46
  Archived months: [jan2016] [mar2016]

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