Beginners - August 2017 (Page 16)

Average contents in array object
 
I need help figuring out how to average the contents of an array in my program. The program needs to create any number of objects (named test) and then average ...
[1 reply] : Hello TheEurekaMan, I will let the comments of the code say most of w... (by Handy Andy)
by BOAC
I need help with my program.
 
I'm very new to C++ and I don't understand what's wrong with my code. If the age is less than 18 or greater than 99, it should just quit the "game", but it cont...
[3 replies] Last: In your IF statements, you had if (age < 18 && age > 99) I suggest y... (by Handge)
basic invalid number detection (command arguments)
 
The question is.. if you use the atof() function, which is used to convert a string to a floating‐point number (type double), the only valid argument to p...
[10 replies] Last: > determine if the characters in each argument are suitable for conv... (by JLBorges)
Double Linked List insert not arranging in order
 
I am writing a program to create a linked list or chars and have them places in ascending order but I can;t seem to get it to into ascending order. It seems all...
[7 replies] Last: Here's code that works. The biggest problem was that you were insertin... (by dhayden)
Why is the attribute c set without initialization?
 
This is my code: #include <iostream> using namespace std; struct C{ C(){ cout<<"C cst" <<endl;} ~C(){ cout<<"C dst" <<endl;} }; struct A{ ...
[5 replies] Last: I understood thanks!! (by puertas12)
by Kuluoz
How to check String in startwith function?
 
i have one buffer//unsigned char *buffer =NULL. it is dynamic buffer . run time only get size/length . i want to check starting string only. previously i ...
[2 replies] Last: Thanks. It is work. (by Kuluoz)
by zeus
Increment and decrement operator help
 
I've been slowly getting my way through a teach yourself C++ book and so far its been great. I like the structure and explanations and feel I am learning someth...
[4 replies] Last: Thanks Jonnin, I was a bit careless with my response. The sequence of ... (by zeus)
this code keep crashing while no compiler errors
 
This code keep crashing while compiler gives no error! #include<iostream> #include<string> namespace std; class space { public: void Set_spa_na(string...
[4 replies] Last: thanks I will try and see if it works with me (by M S A H O)
by DylanZ
Need some help on Cointoss !!
 
So this program suppose to let user insert how many times they want to toss the coin and then the program will generate random numbers between 1 -2 , 1 for hea...
[3 replies] Last: #include <iostream> #include <cstdlib> #include <ctime> using namesp... (by closed account 48T7M4Gy)
by i773
Dynamically instance objects (like a template)
 
I'm trying to create a template blueprint type class and trying to figure out the best way to handle instancing a new class (From a templated) class. Essentiall...
[8 replies] Last: No. 17.6.2/3 A member function template shall not be virtual. http:/... (by JLBorges)
Source Keeps Crashing
 
Just Practicing Arrays but my source keeps crashing with this program. Why? #include<iostream> #include<string> #include<iomanip> #include<fstream> #i...
[4 replies] Last: Thank you all for your help. (by ThatGrayRock)
Protected inheritance
 
How does protected inheritance work. Here child_protected inherits Base as protected. Now the public member of Base is protected for child_protected class. So ...
[3 replies] Last: http://www.gotw.ca/publications/mill06.htm https://stackoverflow.com/q... (by keskiverto)
Connecting to IRC via Winsock
 
I am trying to connect to an IRC server with WinSock. I have an end goal of making a Twitch.tv Chat Bot, but I run into one issue. For some reason I do not rece...
[4 replies] Last: Thank you @coder777 giving the buffer an actual size fixed it! I as we... (by ExSanity)
makefile setup with boost included
 
I'm trying to create a makefile for a small test file that includes various boost .hpp files. I've created a makefile as follows: $ cat makefile CC=g++...
[1 reply] : Maybe it doesn't like for -lboost_system to be specified before smal... (by helios)
how to sort a deck of cards by rank then suit
 
i wrote a predicate function to sort the deck by rank , then by suit. in there i have an else expression commented out. when i comment out the else part , th...
[6 replies] Last: Of the mainstream compilers, void main() 'works' only with the Micro... (by JLBorges)
by zeus
Should I buy a new book?
 
Quite a few years ago I had the idea of learning C++. My student account with Microsoft gave me access to a free copy/key for Visual Studio C++ 2010. So I bough...
[5 replies] Last: Thomas, you're quite right about MFC; C::B would still be a valid opti... (by gunnerfunner)
about regex
 
first thing is i want to check if the user has supplied a string of "-c" in the method scan2c. if the user did then the regex expression extensions takes of th...
[15 replies] Last: Any word enclosed within opening and closing parentheses: \(\w+\) ... (by JLBorges)
C++
 
I read this code but I don't understand the const chat ent = '\n'; and while (ch! =ent) int chcount=0; Const chat ent='\n'; Char ch; Cout<<"enter charac...
[2 replies] Last: Hello Shubhamkapoor, I think line 2 was just a typo from someone. The... (by Handy Andy)
Computer Not Following Formula Right
 
My remaining balance should be constantly going down all the way to 0 but for some reason acts like a quadratic formula. #include<iostream> #include<fstream> ...
[6 replies] Last: Hello ThatGrayRock, You are welcome. Any time. I would be interested ... (by Handy Andy)
class members, The loop only prints the last index
 
Stack around variable 'workers' was corrupted message keeps popping up. Why does the cout at the end only print out the last used input? // This program ...
[1 reply] : @kretosa In the body of main(), change the NUM_EMPS in lines 64, 67, ... (by whitenite1)
August 2017 Pages: 1... 14151617
  Archived months: [jul2017] [sep2017]

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