How do I do that, I'm unfortunately terrible at this
Type: Posts; User: knoxmaddog
How do I do that, I'm unfortunately terrible at this
#include <iostream>
#include <string>
#include <fstream>
#include <cmath>
using namespace std;
const int N = 1000;
void pass_array(double array[N]);
Thanks guys, I got it working. Really appreciate the help.
OK, this is what I have and it's clearly not working. Anyone know what my C++ defecient brain is doing wrong.
#include <iostream>
#include <fstream>
#include <string>
using namespace...
Okay, maybe it will help if i state the end goal cause I am still confused and clearly no good at C++. I have to make a calculator function to calculate the median of an array. I know how to do...
This is where I have my problem.
void pass_array(int array[])
What goes inside the square brackets?
Hmmm. Okay, I'm going to try that.
I have this code to store data from an array;
double main()
{
ifstream data;
double n[N];
string filename;
int count(0);
Haly crap, thanks for the help, I finally figured it out. You've managed to do in 5 seconds what my professor couldnt explain in the past 3 weeks. Thanks.
Thanks for the help, I'm going to try that, knowing my luck with this, I'll be back.
So basically, i should read the data out of the file in main into an array, then send that data to the function to be averaged.
This one actually works, sorry about that other one
#include <iostream>
#include <fstream>
using namespace std;
const int N=1000;
I need to make a main function and have the filtering of the data occur in a second function which is called from main.
This is what I have so far
#include <iostream>
#include <fstream>
using namespace std;
const int N=1000;
I have a basic understanding, and I'm able to write the moving average function, I just don't understand at all how to make one that is callable from another function.
Alright, I'm a mechanical engineering student taking a mandatory C++ course and I am absolutely terrible at it. I currently need to write a program that I've been trying to write for a week and it's...