Beginners - May 2016 (Page 26)

How do you pass double pointers in a function?
 
So, I declared a 2D array using double pointers. #include <iostream> using namespace std; int main() { int **ptr; int numofrow = 0; int numofcol = ...
[3 replies] Last: If x is a double, then &x is a pointer to a double So if ptr is a poi... (by Moschops)
Return value of a function
 
I'm a newbie to C++ programming. I'm learning about function. There is a case that I'm wondering about return value of a function. E.g the following function: ...
[6 replies] Last: I found some similar functions to my function in this link: https://co... (by ivanov ivan ivanovich)
by mkb555
Array of structs default values
 
If you declare an array of structs without defining any of the elements, do elements of the array default to NULL? Its hard for me to check since structs don't ...
[4 replies] Last: One other comment. Its hard for me to check since structs don't come... (by Chervil)
by kev558
Values in array change after assignment when using try/catch
 
I'm trying to use try/throw/catch to check the values of cos(theta) and sin(theta) as they are not quite 0 at theta=90 etc. I originally used the following code...
[7 replies] Last: Hi, Another thing: In the original code: if ((angle == 0) || (angle... (by TheIdeasMan)
Ofstream writing error?
 
Hello everyone, I am creating the simplest program. At the top I am including basic ifstream and ofstream objects to display the previous user, and enter new na...
[3 replies] Last: Ok, so you are reading a name and store it in a string variable named ... (by Peter87)
sorted multimap
 
Heylo! I have to do an abstract data type: sorted multimap and in the implementation to use a binary search tree.I've tried looking for some theory and examples...
[1 reply] : > I need an idea of how can I use this ADT, so I can prove it's utilit... (by JLBorges)
by kev558
Problem using header files for the first time.
 
I know this has probably been asked 100 times but I can't find a thread which helps. I'm using header files for the first time and the file is to initialise an...
[11 replies] Last: Hi, Just on your actual code: Try to avoid raw pointers and new and ... (by TheIdeasMan)
Histogram help
 
Can Someone help me with a histogram that gets its values from an array in an input file. #include <iostream> #include <fstream> #include <string> us...
[2 replies] Last: Thomas1965 that worked Thank you! (by Batman93)
functions, passing by reference
 
So i am writing this code for my computer science class and i am stuck. It is supposed to do this: Enter a total: 20.31 Enter amount tendered: 22.00 You...
[6 replies] Last: Prototype would be void calc_change(double change, int &quarters, int... (by Tyler T)
Problem in creating a .cpp file in Microsoft Visual Express 2015
 
I have installed Microsoft Visual Express 2015. Everything seems good,however when I created new project [Win 32 console], I chose empty project. I tried to add...
[no replies]
Formatting output
 
Hi, this problem has been bothering me for a little while now because I can't seem to locate the problem. My problem is I can't get the formatting for my output...
[2 replies] Last: Names is a string and the longest one is 20. Name ... (by hobbit36)
by mamoyo
Manhatten & Euclidean
 
Please could you help me with the following.. I would much appreciate an explanation to how you get the solution. Many Thanks
[3 replies] Last: the Euclidean distance or Euclidean metric is the "ordinary" (i.e. st... (by JLBorges)
cout Issues
 
Hello, I am reading the following data: Johnson 5000 Miller 4000 Duffy 6000 Robinson 2500 Ashtony 1800 I would like the name, number of votes and perc...
[1 reply] : First I suggest you review how to declare variables in C++, you seem t... (by jlb)
Need help with this program assignment
 
So at this point I am lost. My teacher wants us to generate an array that contains random positive integers that will allow the user to do different things wi...
[7 replies] Last: Thanks for all the help guys (by kaylah93)
Rand not working correctly
 
For some reason i cant get it to spit out random numbers, both numbers it generates are the same. #include <iostream> #include <iomanip> #include <cstdli...
[2 replies] Last: Wow... I can't believe i missed that.... Thanks, it works. Haha (by GigaMuff)
by vlad61
unexpected while loop
 
im having trouble understanding what is happening here. I would like the program to continue the loop while i input numbers or operator signs.... however to bre...
[no replies]
Help with simple XOR file encryption program
 
The program I have will encrypt text files properly, but when I try to encrypt something with a different file extension such as a word document it only encrypt...
[no replies]
Writing vectors to ofstream
 
So I'm working on a program to encrypt a file by reading a file, adding 8 to the ACSII code, and writing it to a second file. I've never done casting before so ...
[1 reply] : //Call encryption function void encryption(vector<int> out, ifstrea... (by ne555)
Help with this class please
 
Im having an issue with the class employee constructor class Employee { public: Employee() { char person ="None"; strcpy (name, person); ...
[no replies]
Need Help Finding Error in Employee Object/Class
 
I am creating a program that takes the user's information and displays it back on the screen. I have been successful in getting the majority of the program to w...
[2 replies] Last: Thank you for your quick response. I meant to respond sooner, but work... (by avid programmer)
May 2016 Pages: 1... 2425262728... 36
  Archived months: [apr2016] [jun2016]

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