Beginners - March 2016 (Page 26)

Hints and tips for a little menu class
 
Still on my quest of creating a nice little console framework for myself. Today I am starting some work to help improve my programs flow of control. I thought a...
[no replies]
Counting Integers program help!
 
Hi! So I'm a freshman CS major and currently on spring break, and I'd figure I could do a few simple programs in my textbook to practice and try to improve a...
[1 reply] : You are (un)lucky. On line 11 you do declare variable numbers, but do... (by keskiverto)
Simple Calc: Problem 2
 
Hey guys,my previous attempt at making a calculator was a dumb,so I started searching the net for some ideas. Interestingly,the one that stood out was using a ...
[3 replies] Last: Why not learn from the experts? Here is a demo from Bjarne Stroustrup ... (by Thomas1965)
Split string into sentences?
 
I need a little code to split a phrase/paragraph into sentences. For example: "My house is on fire. That should not be happening." Is splitted into "My hou...
[6 replies] Last: Oh, thakns. That helped. (by InsanelyNormal)
size_t and hashing
 
I got carried away and have been reading the pages on std::unordered_map , unordered_map::hash_function and std::hash . I learned from reading the std::h...
[1 reply] : size_t is a type. Like: unsigned or int . It is guaranteed to ... (by cire)
Expression must have class type error.
 
#include "stdafx.h" #include <iostream> #include <string> #include <algorithm> char grid ; int main(){ char grid ; int i; int j; for (i = 0; i < 7; i++)...
[8 replies] Last: every time it returns the P back to O again I suggest you separate o... (by Chervil)
Printing 3D Arrays
 
I am about 3 months into learning C++ and am messing around with printing multidimensional arrays. My problem is that I cannot for the life of me figure out why...
[3 replies] Last: Thank you so much! I'll mess around with this more until I get it! (by tehHuzzlenut)
trying to get out of loop + start a new display
 
i'm stuck in while loop, i tried doing break; but errors. I have a bunch of while loops because the user has to input 5 scores. If it's not valid, it'll ask for...
[4 replies] Last: ok i changed OS' from Mac (Xcode) to visual studio and it solved my pr... (by badw0lf)
How to make a program do something by pressing a key on the keyboard
 
Let's say I made a program which would display "Hi" when I hit the 'a' key. what line of code should I use to do that? and please explain the concept, thanks...
[1 reply] : You could use GetAsyncKeyState, from <windows.h>, to detect the key as... (by InsanelyNormal)
by halagi
[help] style of object creation in C++
 
Hello, I met a statement like the following. But I don't know whether the statement of object creation is ok. class Fraction{ private: ...
[2 replies] Last: This is something that often confuses people. Fraction a(); looks a... (by MikeyBoy)
nullptr and delete
 
This is for my data structure class. The textbook creates a LinkedBag using a Node class. In implementing the remove for the LinkedBag, near the end, they do n...
[1 reply] : So I'm wondering if setting it to nullptr is doing something more. I... (by keskiverto)
Encryption/decrytption program. Files not opening.
 
Hello everyone, this is my first post to this website. I have a problem with my code that I cant seem to track down. I dont know if my files arent being passed ...
[3 replies] Last: What I suggest is to start simple, and add any other features graduall... (by Chervil)
hangman
 
Hello. Im planning to make a hangman game for c++ as my project, i was planning to use txt file for the words and i would like to have a hint on it. Can someone...
[2 replies] Last: but how can i make an option to prompt the user if he wants to have a ... (by ProgMan)
Variadic template function not working
 
Hi, I want to make this function to check if all the arguments are true but this doesn't work and from compiler warning I can really understand the problem. ...
[5 replies] Last: Tnx man for the information but now I'm not that good with installing ... (by etrusks)
Please, Help
 
Hello, I am completely new in programming and I need some help, please. So the thing is I have to make a program which equals that function : f(x)=xe^x and I ne...
[2 replies] Last: I'm apologize about my stupid question, You are right! So the thing is... (by hissatsu)
Function is not calculating my coefficients
 
Why isn't my my function getRoots not calculating my inputs? #include <iostream> #include <cmath> using namespace std; int getRoots(double a, doubl...
[2 replies] Last: Thank you. This helped a lot. (by Catungal)
Choosing a random number gives me error in array
 
My code #pragma once #include <iostream> #include <cstdlib> #include<ctime> class Sentence { private: char *articles ; char *noun ; char *ve...
[2 replies] Last: int r1 = rand() % 6; This will return a value from 0 to 5 , inclusi... (by integralfx)
MidTerm Exam Question
 
So I have a question on my midterm that is stumping me; Use the pointer fptr and a for loop to loop through the array of numbers. I tried to do: double n...
[4 replies] Last: If you would like to use the address-of operator (&), you can just do ... (by integralfx)
Reversing a value
 
I'm reading a list of values from a text file and storing them into a vector. The list of values I read are: 13 21 5 37 15. I'm storing these values in one ...
[2 replies] Last: I would recommend converting each number into a string. This makes it... (by integralfx)
How do I get my main function to switch from case 0 - 2 with my int function?
 
#include <iostream> #include <cmath> using namespace std; int getRoots(double a, double b, double c, double & s1, double & s2) { double disc = (b*b) - (4 *...
[2 replies] Last: Thank you so much! (by Catungal)
March 2016 Pages: 1... 2425262728... 47
  Archived months: [feb2016] [apr2016]

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