Beginners - June 2017 (Page 6)

by H00G0
Trouble debugging code for a simple program.
 
I am getting the error message 'in function "int main()': invalid conversion from'char*'to 'char' initializing argument 1 of 'bool studentResults(chat char, boo...
[2 replies] Last: Oh wow i didn't know you had to define arguments as arrays in the prot... (by H00G0)
Program crashes upon trying to access a double pointed Eigen matrix
 
Hello, I'm currently working on a neural network program (for playing tetris). The following bit of code is what causes me problems: (taken from the weights par...
[3 replies] Last: Well, that was a rookie mistake ... Everything works now ! Thank you ... (by Sporarum)
by sharbu
Scan an array without knowing length
 
sample input constraint = 1<arr size<1000 sample input: 1 2 3 4 5 sample output: 1 2 3 4 5 eg: arr =1 arr =2 arr =3 arr =4 arr =5 samp...
[2 replies] Last: It should not be possible to not know its length. If its an array, yo... (by jonnin)
Program help
 
Problem: A movie theater only keeps a percentage of the revenue earned from ticket sales. The remainder goes to the movie distributor. Write a program that cal...
[10 replies] Last: Thank you, with the links you provided and the example you gave me, I ... (by Bayan Khorshidi Berkeley)
Polymorphism with smart pointers
 
I am trying to move past a "C with Classes" approach to C++11 and C++14. My topic du jour is polymorphism, but with smart pointers. Say, I have a set classes...
[6 replies] Last: it looks like the default constructor is deleted rather the copy cto... (by gunnerfunner)
by yhuong
can you help me explanation for all this code???
 
this code about least cost method. Thank you!!! #include<iostream> using namespace std; int main() { int c , i,j, min, m, n, b, d, c2, c1, p, q; in...
[2 replies] Last: Hello yhuong, Part two: #include <iostream> #include <limits> usi... (by Handy Andy)
Dynamic 2d Array Memory Leak Problem/Question
 
I am writing a program to compute the levenshtein distance between two strings based on two command line arguments(text files), and this currently does it. Howe...
[4 replies] Last: So the breakpoint error I got in visual studio disappeared when I chan... (by aiiight)
Never knowing what a class should contain?
 
I suck at seperating data for some reason. So I'm trying to rewrite how I'm making a SFML game to make better use of classes and OOP to make the code look clea...
[7 replies] Last: > I will have to research what a throw-away design prototype (is) Str... (by JLBorges)
by TheArk
else if
 
Here is my code thus far, the problem I am now having, is that when I get to the else if function, it will cout only the if function, however if my input = one ...
[3 replies] Last: awesome thank you! (by TheArk)
thread1 finish before thread2
 
Hi there, I want the producer thread finish before the consumer thread gets executed. How can I do that? the output looks like this: buffer 1 has value of 1...
[3 replies] Last: the simple approach is to wrap your thread creation and execution in a... (by jonnin)
Multithreading Synchronization
 
I am currently taking a university course that asks us to improve on a non-multithreaded solution. The program, when presented with a list of numbers, counts th...
[2 replies] Last: its "usually" faster if you can make totally independent threads so yo... (by jonnin)
by xxvms
Library question
 
Hi there I am working on assignment where I have build library with books Library have limit of how many books it can store. Books have unique ID. Books...
[2 replies] Last: It all depends on what other operations you need to support. If possib... (by dhayden)
Please Help! Function does not take 1 parameters
 
My program converts from Fahrenheit to Celsius and vice versa, with the option of displaying the Kelvin temperature with a Y/N message. When compiling, two err...
[4 replies] Last: You need to think about what showDegrees() should do. Looking at your... (by dhayden)
Question about Reading text files into strings from command line
 
Hi guys, I am currently trying to write a program which involves me writing two arguments to the command line like so: > program 1.txt 2.txt >1.txt ...
[1 reply] : You are almost there: string s; string full = ""; while (getline(fi... (by megatron 0)
threads
 
hello, I am here to ask why this code is not working properly #include <thread> #include <iostream> #include <vector> void check(int& val, bool& b) { ...
[13 replies] Last: Coder777: while writing the reply to the following thread ... http://... (by gunnerfunner)
Problem with rand()
 
I used the function rand(), of the library <cstdlib>, to generate a random number and everytime I run it it returns 41. #include<iostream> #include<cstdlib> ...
[2 replies] Last: Thank you JLBorges, it worked. (by orestisman)
Error from iterating list
 
Hi, I am using iterator to go through the list std::list<cv::Mat>. Terminal gives me erros as following: error: conversion from 'std::list<cv::Mat>::it...
[2 replies] Last: Thank you. (by waschbaer)
New to C++
 
I am starting college as a computer science major. I am taking all my prerequisites and one of my classes is a C++ course. I would like to learn C++ before I s...
[2 replies] Last: Buy this book, or look for the PDF version for free on google. I recom... (by BlackSky)
by xari2
Function result is not accurate
 
Hello Dear, please check following program which is running fine but output result is not correct. please help me to sort out issue. #include<iostream> u...
[4 replies] Last: @mbozzi, thank you dear, i got it. please recommend me latest compiler... (by xari2)
Please Help!
 
I want to find the lowest price i need to pay to convert text so that every word has only upper or lower case letter.Converting 'A' into 'a' costs 1 $ and 'Z' i...
[6 replies] Last: > But when i try with "aA zZ" > or when i try with "You Are NoT Alone"... (by ne555)
June 2017 Pages: 1... 45678... 16
  Archived months: [may2017] [jul2017]

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