Beginners - April 2019 (Page 16)

namespace std
 
why is putting using namespace std bad or just not worth using?
[5 replies] Last: [quote=Ganado]It's bad if you put it in a header file because you're f... (by Peter87)
Entering array-index in class at runtime: possible?
 
I have a class: indiv The "workhorse" part of the data is a 2-dimensional array: int chromosome To make the code more flexible, I would like to be able to mak...
[2 replies] Last: Thanks. I'll get reading :) (by phalangium)
Error No Acceptable Conversion
 
I am starting a new assignment on operator overloading. After performing a simple addition I get an error saying, " error C2679: binary '<<': no operator found ...
[10 replies] Last: Ok I see what you mean. Thank you, I appreciate it. (by stoneJax)
by sturk
C++ compilation error
 
Can someone explain to me why are the codes below not compilable? I don't understand. Thanks. Revising for a test. Given the following code: class A { int...
[1 reply] : It will be a compiler error. A reference needs to be associate with an... (by coder777)
by sho
Design Pattern for Sensor API
 
Hi all, I'm an embedded c developer who is starting to explore embedded c++. I'm currently working on a project where a remote device will be responsible for mo...
[7 replies] Last: I would design it like so: struct input_type { ... }; struct sensor... (by coder777)
Help for code on rand and board
 
I am quite stuck on a homework assignment. I have a function that has to recognize 3 boards and randomly display one and if the user gets the answer wrong then ...
[2 replies] Last: NULL is meant for pointers. If you mean zero you should write 0, or us... (by Peter87)
Tried to type out a code for volume calculations
 
Hi, I am a student who just started with C++ coding. Trying it out on my free time. As I have just started recently, I am decent at the basics of C++ coding, bu...
[2 replies] Last: Hi, thank you for taking your time off to help me with this. I had t... (by Chemystery)
Help with passing a variable by reference
 
I am trying to pass a user inputted number to a void method by reference and adding 2 if even and 5 if odd. I am getting the following errors on line 23 express...
[2 replies] Last: Thank you for the help it's working!!! (by Flynn Rhodes)
C++ Builder v6 opening .h file.
 
I am working on some old code using the C++ Builder v6 IDE. I added a *.cpp file to a package. Normally when you click on the cpp file the code opens with tab...
[1 reply] : I’ve never used C++ Builder, but from your account, it doesn’t see... (by Enoizat)
Question for char *
 
Hello guys.I do not know where i am wrong.IN part of my program a am working with char *.ReturnWord returns one word in my case it has two characters (word do) ...
[2 replies] Last: Thank you very much. (by Zivojin)
Help with simple problem
 
I am learning to code and am trying to work through some old practice problems from American Computer Science League competitions. One that I had come across to...
[3 replies] Last: I just executed it with the first example: Enter the coefficients for... (by MikeStgt)
if statement conditions
 
I have what I feel like should be an easy logical error to solve but I do not know how to properly write the "if statement". Given the 4 options of W, X, Y, ...
[3 replies] Last: Nice! (by Duthomhas)
data structure
 
error in line 18,21. can someone help me with this? using namespace std; #include <iostream> struct Student { char FirstName ; char LastName ; do...
[2 replies] Last: struct Student { char FirstName ; char LastName ; double GPA... (by closed account z05DSL3A)
by arg57
Having Problem With a Vector Function.
 
I'm having a problem with the sumVector function part of this program.the loop to sum and the way to call the function The description on what to do is as follo...
[17 replies] Last: I saw in another thread that Handy Andy was being...uncharacteristic... (by closed account z05DSL3A)
by Bopaki
Help as to why my stack gives no output
 
Here is my code: //Header File linkedStack.h #ifndef H_StackType #define H_StackType #include <iostream> #include <cassert> using namespace ...
[10 replies] Last: #include <iostream> #include <cassert> #include <new> template < cla... (by JLBorges)
how to become a framerate pimp
 
Is there a #include library that holds some functions that can allow me to control the framerate of the screen.
[4 replies] Last: 2. There are regulars here who have a good grasp on the inner workings... (by deleted account xyzzy)
Writing if/else statement as a function
 
Hello, again guys. I'm trying to properly write out an if/else statement as a function that returns a true or a false to indicate if the end time is greater th...
[12 replies] Last: yes but now consider what we told you above... bool endGreaterThanSt... (by jonnin)
by wuwy
Whats wrong with this "for loop"?
 
In this case max=24 and strips are: 14, 23, 20. I need all of them to reach 24 and print out how many extra strips did we need to reach that number. I'am probab...
[3 replies] Last: inside the inner loop but NOT inside the if statement, add this: cout... (by jonnin)
Elevator service using Classes and Boolean variables
 
My code is supposed to service 3 floors while attempting to service a 4th floor, before going back down to the first floor. I have it set up that user input of ...
[2 replies] Last: On lines 55, 60, 84 you need to OR two logical comparisons, not write ... (by lastchance)
Please help
 
Description: Write a program which calculates and displays a baseball player's batting average and proficiency. There are an unknown number of players. For any ...
[4 replies] Last: lol how should I go about fixing it? when i made this update it errore... (by austindavenport)
April 2019 Pages: 1... 1415161718... 24
  Archived months: [mar2019] [may2019]

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