Beginners - April 2017 (Page 5)

by Krok2
Best way to Find amount of chars existing in both strings
 
I want to know how many chars exists in both strings. getPoints("hey", "hai") would give: 1 point getPoints("hi", "hai") would give: 2 points It's simple bu...
Apr 27, 2017 at 9:20am
[5 replies] Last: The following version WILL allow duplicates ('l', 'l', 'o' in the exam... (by lastchance)
by Anami
Garbage value in adding of two matrix objects.
 
I want to add two matrix objects using friend function.The program runs and take inputs but at the end it shows garbage value. #include<iostream.h> #incl...
Apr 27, 2017 at 9:16am
[5 replies] Last: #include<iostream.h> #include<string.h> #include<conio.h> class matri... (by Anami)
Issue with program that reads a .txt file
 
I am trying to create a program that reads a .txt file, displays it, counts unique words and displays unique words next to how many times used. So far I have th...
Apr 27, 2017 at 8:46am
[3 replies] Last: If you just want to print the original contents of a file you can use ... (by lastchance)
Help with code
 
I need help making this code print the first n numbers #include "std_lib_facilities.h" bool Prime(int a) { for(int c = 2; c <= a/2; c++) { i...
Apr 27, 2017 at 7:41am
[5 replies] Last: Sometimes it helps if you write your plan down in plain English like t... (by Thomas1965)
Converting from int to string doesnt work
 
Hello folks, im creating a program, that checks whether a number is a Neon Number (a number where the digits of the square of the number are equal to the numbe...
Apr 27, 2017 at 7:34am
[6 replies] Last: Somehow I was thinking that 0 is not a valid number - probably it was ... (by Thomas1965)
Display a hexadecimal address as a decimal?
 
I have a program that uses a function to return addresses for specific elements inside and outside of a dynamically defined array of floats. As anticipated, whe...
Apr 27, 2017 at 5:59am
[3 replies] Last: This is a simplification, but basically static_cast will only convert ... (by mbozzi)
by Drakk
system() issues on Linux
 
...
Apr 27, 2017 at 5:27am
[2 replies] Last: Thanks so much. i was super confused. (by Drakk)
What did I do wrong when calling out this function
 
So here's my code: #include <iostream> #include <iomanip> #include <fstream> #include <string> using namespace std; //function prototypes int rea...
Apr 26, 2017 at 11:14pm
[5 replies] Last: Does this count as not coding? ifstream inFile(inFileName); readRainF... (by imastruggler)
Comments for a script
 
Hey guys! This script has appeared in an exam for a module I have in college. I would really appreciate if you could tell me if I explained it properly and ...
Apr 26, 2017 at 10:58pm
[2 replies] Last: :D Thanks, man! (by Alex1993)
Vector not printing
 
Hi. So im using a vector to create a contain, so that when the player is asked in PlayerChoise() if they want to keep an item, the item has somewhere to go. How...
Apr 26, 2017 at 10:39pm
[1 reply] : > I keep getting the same error > Error on line: > cout << "Bag Item: ... (by ne555)
Population Growth Function
 
I am stuck on a homework assignment where I must create a population growth calculator. The thing is that I have no idea how to make the calculation repeat so t...
Apr 26, 2017 at 8:56pm
[3 replies] Last: [code firstline=67] for(int i = 0; i < numYears; i++) { cout << ... (by AbstractionAnon)
Plese Ignore this Post
 
Just putting this here for a report /** ****************************************************************************** * @file main.c * @autho...
Apr 26, 2017 at 8:46pm
[no replies]
Monte Carlo Problem
 
Solved.
Apr 26, 2017 at 8:37pm
[2 replies] Last: @zelotic, Please reinstate your original post. People will be disincli... (by lastchance)
by Krok2
For loop crashing at the end
 
Here's my code cout << "Input: " << history << endl; map<char, int> result; for (auto& v : children) { cout << "Loop" << endl; cout << ...
Apr 26, 2017 at 8:17pm
[4 replies] Last: Turns out the layer two was saved given by parameter (not as pointer) ... (by Krok2)
by tt13
summing up array with negative number
 
Hello volks, I'm trying to write an array that add 10 integers from user's input. That will include negative numbers. My program seems fine with different test,...
Apr 26, 2017 at 7:14pm
[2 replies] Last: OMG, that's right I did a stupid calculation, LOL, thank you! (by tt13)
by past98
Using functions from other classes and printing
 
Hello guys. I have an excercise and I need some help. I am asked to play a game that has a number of players and a number of heaps inserted by the user. Each he...
Apr 26, 2017 at 6:10pm
[no replies]
use std::tolower() to find a keyword in a string
 
my programme: int main() { int i, sep; string name = "We Are The Champion!"; string keywords = "Champion"; string word; for(i ...
Apr 26, 2017 at 5:42pm
[9 replies] Last: Quite right Thomas, but usually I have 3 reasons for making such posts... (by gunnerfunner)
Operator += applied a to a string value
 
I was going through this code I found on the c++ website and I haven't been able to figure out why the += works with string and char characters. Would anyone be...
Apr 26, 2017 at 5:41pm
[4 replies] Last: Ahhh okay it's overloaded, got it, thanks for the links guys. (by thinkCode6365)
Pig Latin Translation not working properly
 
Ok first of I know my code is all over the place which is probably why I'm lost but anyways this program is supposed to have a word separator and pig latin func...
Apr 26, 2017 at 5:38pm
[5 replies] Last: Ok I find out why the pig latin was displaying the same output as the ... (by PiNOYPANDEMiK)
Voice commands
 
I was wondering what do I need to add voice commands in code. Like if I say "Open computer" it opens My computer and things like that. Do I need any special har...
Apr 26, 2017 at 1:20pm
[no replies]
April 2017 Pages: 1... 34567... 34
  Archived months: [mar2017] [may2017]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.