Beginners - May 2017 (Page 15)

How do I write a binary search sorted array?
 
For some reason, the program won't output the binary search. It doesn't say there's anything wrong with the code, but when I try to run it, it keeps saying "bin...
[7 replies] Last: But I did define it... No, binaryList(...) isn't defined. I would th... (by coder777)
How to use a chart in C++?
 
Hi, In my program, I want to implement a chart that can be looked through by the program. For example, the left side would be 0-600, and the right side would ...
[2 replies] Last: Hello yuriy14, My first thought is to use a "std:map" and a "std::pai... (by Handy Andy)
Help With Quadratic Code
 
Hey there and thanks for any help. so I've just started programming kinda and i wanted to make a function so i thought a program that does the quadratic formul...
[4 replies] Last: Yes, if you are using the keywords "true" and "false" that should be ... (by jonnin)
by Kiryu
OpenGL Diffuse shader problem
 
Hey, as always, I'll jump right into it! I'm writing a 3D game engine, and the diffiuse lightning seems to have some issues. It would be hard to describe the ...
[2 replies] Last: Well i adapted the code like you suggested, and it seems to work bette... (by Kiryu)
by Toxiic
How do I change the value of a 2d array using a 1d array?
 
So I want use a 1d array to change the value of a 2d array if one of the values in the 2d array equal k. It doesn't seem to change it to a different value that ...
[1 reply] : Why do you think it's not changing? What specific behaviour are you s... (by MikeyBoy)
Multi-Dimensional Table Printing
 
I am trying to print an ASCII maze, but when i activate my "outputMaze" function it doesn't print out the whole maze. The table is 7 x 7 but it only prints 6 X ...
[2 replies] Last: In a 7-element array, the last index is 6. So, your while condition ... (by MZH)
by lare26
Unwanted Trailing Image SDL2/C++
 
I run this program and get trailing copies of the currentImage. I don't know what I am doing wrong. I think there is a function that clears the old image as the...
[4 replies] Last: Thank you, Peter87. (by lare26)
Inserting and Removing elements in a dynamic array
 
I'm having trouble with inserting and removing a element from a dynamic array and I would like some guidance on where to start off. Also, i am having issues obt...
[no replies]
what prints?
 
int n; cout << "enter a positive number: "; cin >> n; if(n < 0 or n == 0) { cout << "invalid input, enter again: "; cin >> n; } n +...
[1 reply] : I guess undefined behaviour ++n = i + (n%100); //warning: unsequenced... (by ne555)
by wolfv
Makefile - place object files in obj directory
 
I am trying to write a Makefile that will place object files in obj directory. This Makefile creates a f1.o file as expected: CXX = g++ CXXFLAGS = -Wall...
[4 replies] Last: if you have several sources then you'll need to write that same rule f... (by ne555)
Why does the program not let me write the function?
 
It keeps saying "Function definition is not allowed here". int searchList(int list , int numElems, int value) { //Around here int index = 0...
[2 replies] Last: I fixed it. Nm (by imastruggler)
rejecting and ignoring invalid values that do not belong in a set
 
I need to return a set of elements in an array via a parameter from this member function int IntegerSet::elements (int arr ) const. Also, I need a bool member ...
[1 reply] : http://www.cplusplus.com/forum/beginner/1/ With much thanks (by Kiryu)
by Meden
Skipped cin statement
 
I understand that there are better ways to validate input than what I have written. I am not trying to fix my code. I just want to understand why the second c...
[4 replies] Last: I think maybe you guys are entering in a double rather than a string i... (by Meden)
Linked List, Search function non-operable
 
Hey all, I'm trying to get this Linked List Program for an assignment. I've finally gotten the program to run but the search function isn't working correctly. I...
[2 replies] Last: Solved it with this code.. it's not perfect at all (check if no char i... (by p3p3)
by Faggio
Difficulty with assignment
 
My prof wrote this .h file of class Data that I have to implement. class Date { public : // Dafault Constructor , set the date to the actual date Date (...
[2 replies] Last: Sorry but i'm not expert! Thank you for your time and for your reccoma... (by Faggio)
Char to int
 
Hello, I just want to know if there is any function which convert char to int (for example '1' will be converted to 1) and throw and exception if char is not a...
[5 replies] Last: Haha, very true. Cheers ;) (by mbozzi)
by rudger
Formula help
 
I'm trying to create a formula but I'm not getting the right result. The outcome should be: 0.46 (0.66 - 0.2 = 0.46) (0.66) - (100 / 500) 0.66 - 100 /...
[1 reply] : 100 / 500 equals zero. 100 is an int and 500 is an int. In C++, an... (by Moschops)
What am I supposed to do with these arrays?
 
Here's what I'm supposed to do: "Your program should use the following one-dimensional arrays. empId: An array of long integers to hold employee identific...
[12 replies] Last: @AbstractionAnon it works! Thanks so much! (by imastruggler)
boolian conditions and functions
 
Hey. I am trying to get this simple math function to work. The function recieves an operator and two numbers and in theory, is supposed to change the value of ...
[1 reply] : Line 7: main must always be type int Line 14: This is a function ... (by AbstractionAnon)
string doesn't compare to an array
 
So i have a problem with my program, i enter the band's name and i want to count ow many times it was used in the given list (.txt file). I do it with getline a...
[3 replies] Last: thanks a lot man, the whitespace was causing the problem fd >> ws work... (by krossas)
May 2017 Pages: 1... 1314151617... 24
  Archived months: [apr2017] [jun2017]

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