Beginners - February 2017 (Page 22)

Triangle.cpp
 
My instructor has made a strong emphasis on not allowing others to make major changes to our program while using classes. Such as make changes unnecessarily to...
[5 replies] Last: Let me know if you feel it's worth 90% Well, I'm no teacher and don... (by mbozzi)
Last occurrence? smallest item?
 
i don't understand several functions following do.. these are examples of my project string people = { "samwell", "jon", "margaery", "daenerys", "tyrion...
[1 reply] : I believe it's the lexicographical order of the array, i.e. the string... (by integralfx)
OutFile and InFile of a vector
 
I created a vector that i sent to an external file at first, but later created two files to write too. Now on a seperate program i am trying to read in the same...
[3 replies] Last: #include <vector> #include <iostream> using namespace std; int main(... (by arobles10)
Please Help Me Understand this
 
I am having trouble even understanding what I am supposed to be doing. Most the time I just copy code in class and then rework it but we weren't given that for ...
[3 replies] Last: Have you tried to write a class before? (by Bdanielz)
Run two+ void functions at once?
 
So currently i want to run two functions at once but idk if that's possible without threads void runbot4() { printf("Second one started"); Sleep(1000)...
[2 replies] Last: without having to use threads why? (by gunnerfunner)
passing bool function result to another function
 
i need to write two separate functions one is bool that checks if the input is valid the other is a double function that does something else. my professo...
[1 reply] : if (boolResult = 0)//assigning here, not checking for equality //shou... (by gunnerfunner)
Passing a <map> by reference to a function.
 
Hey cpluplus community! I'm having a little trouble figuring out how to pass a map by reference to a function. This is the function that I have created. b...
[10 replies] Last: Your code needs to be reworked. 172 lines and 8 levels of nesting mak... (by mbozzi)
watch value is different with actually value?
 
Write your question here. Hi,every one, I've try to use dev c++ and minwg+code::block but both side have same result...Is something wrong about zlib1.dll? I ha...
[6 replies] Last: Yes, It's same value! I've change the code : using namespace std; int ... (by olive chu)
Source code needed
 
Scenario 2: Sorting Number Write a C++ program (using function overloaded) to sort 10 integer values, or 10 long values, or 10 double values. Number lists pro...
[7 replies] Last: I knew you could figure it out once you got into it. Now, can you exp... (by jonnin)
by simer
Return incorrect values
 
When I enter money=1, it returns a quarter (true), but when I enter 0.85, 0.95, it keeps returning 0. #include <iostream> #include <string> using namespace...
[4 replies] Last: currency is a specific example of what I was saying about comparison o... (by jonnin)
getting weird error for while loop
 
I'm trying to make this program to take information from a file and save it as a string but every time it gets to the while loop, it crashes. It'll work if I on...
[1 reply] : for (zero<5;zero++; stuff>=6) You might want to review on the syntax... (by integralfx)
Need an explanation
 
Hey, I found some code on the internet and there is something I don't understand. Why is there two colons (::) in front of the GetSystemMetrics function. ...
[4 replies] Last: Ohhh thanks guys (by Day Vide)
Random numer generation question
 
Write your question here. #include<iostream> #include<random> #include<ctime> #include<iomanip> using namespace std; int main() { default_random...
[2 replies] Last: Thanks alot! great response. (by chinaski)
Throwing 'success' and optimising a fstream function
 
I've made a function that retrieves filenames from a binary archive. It's part of the "Archive" class. The filenames are, or rather should be, null-terminate...
[2 replies] Last: reading 1 char at a time is a performance killer. So is testing for e... (by jonnin)
Operator overloading return
 
Hello, I am doing an assignment for school and was wondering if it possible to return an overload. Specifically can you return a conditional overload by calling...
[1 reply] : let's go through the code in steps, with some clean-up of the text: ... (by gunnerfunner)
Can you help me fix this bug.
 
So I wrote this little blackjack program pretty simple and it was working fine except for some reason the draw() function had to be declared in the dealerPlay f...
[7 replies] Last: @Thomas my friends mom is a black jack dealer at a casino they draw un... (by Algoreithm)
'\n' ascii code
 
Hello everyone! Even though this seems to be a simple question, it seems to have a lot of answers. I want to know what the ascii code of escape '\n' character (...
[6 replies] Last: all languages will conform to the OS that you are working on. That is ... (by jonnin)
Converting a String into chars
 
Im trying to read a string from a file "Test.txt" and then count all of the vocals and output the number of vocals.But I get a string from the file and it giv...
[1 reply] : The second argument of getline() is std::string, not char: http://www.... (by gunnerfunner)
Sort command for sorting a map<int, double> by key?
 
Suppose I have a map m defined in this way: m = 0.3, m = 9.5, m = 2. Now I want to sort this map by key, so that it will appear like m =...
[3 replies] Last: iterators iterate (traverse) the container across the container elemen... (by gunnerfunner)
#include <fstream.h> fails
 
I want to open and read a file but when I try to build my program it says "fatal error: fstream.h: no such file or directory" I am using code::blocks to write...
[4 replies] Last: Oh yeah didnt realise I forgot those (by Gammel2012)
February 2017 Pages: 1... 2021222324... 37
  Archived months: [jan2017] [mar2017]

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