Sorry, I forgot to mention that I did the same thing with the sqrt() function. Yes this works and I calculated on my calculator to make sure:
hold[i] = (int) pow(((double)hold[i] - average),2);...
Type: Posts; User: skmightymouse
Sorry, I forgot to mention that I did the same thing with the sqrt() function. Yes this works and I calculated on my calculator to make sure:
hold[i] = (int) pow(((double)hold[i] - average),2);...
I actually was able to figure it out
If I caste the pow as an int and then the hold[i] as a double it works perfect.
Thanks anyways
I do have that declaration I just didn't include it in the code I pasted
I am trying to get the standard deviations in my array and the funtions pow() and sqrt() won't work because "error more than one instance of overloaded function pow". Same error with the sqrt.
...
Thanks Zuk! Perfect
I am trying to pass an array that has tokenized strings converted to integers in them.
I printed out what the array contains in the first function (str_length) but when I pass the array to the...
Sorry, that is a lot to take in at once. I am just going to start by addressing the dynamic array of pointers to char using malloc.
Would the code look similar to this: array = malloc(81 *...
How would I store multiple strings that a user inputs? Also the user can enter as many strings as he wants until he enters an empty string ("str[0] == '\0').
I am guessing I would want to store...
Worked like a charm, thank you
Ok so I did what you said but now the loop only goes through twice and then ends.
1. I know that the loop won't terminate if there is at least one character thats why if the program asks them to input values for the string and they don't enter any values shouldn't the loop...
I am trying to write a program that will store stings until the user enters an empty string.
Here's the code of what I have so far. I am guessing that I need to change the statement at the end of...
I have to do my own sorting.
If anybody knows how I can fix the existing code I have that would be great
I am trying to write a program that will find the meadian and mode of the values in an array.
This is the code I have so far for Median:
void median (double array[], int numItems)
{
...
I think that you were trying to over complicate it because I was able to write it like this without any parallel arrays or structs:
int i = 0, j, n;
double sum = 0, variance;
n...
I'm pretty new to coding so I am currently scouring the internet to figure out what a parallel array is and how to use one. I don't think I want to do a struct of the original array though.
For step 2 would I want to create another array just to store the deviation calculations?
I'm trying to write program that calculates the standard deviation of the numbers in an array.
I was looking at other posts on this site trying to figure it out and I came across this one where...
Thank you so much, this has been extremely helpful. Smokeyangel was completely right and thanks Adak for explaining it very well for me. It runs perfect now!
Sorry I'm not trying to be that guy that doesn't google and research stuff before posting but I searched latter and I didn't get any valid results so I just thought that you might have misspelled it...
It's the latter? I'm not sure if I know what that means.
Ok this is what I have so far, let me know if I'm heading in the right direction at all:
#include <stdio.h>
#include <stdlib.h>
#define FILENAME "C:/mydata.txt"
int read_file (FILE *ifp);
Ya my array has the possibility to hold up to 1500 values are there aren't always going to be that many values so I need it to adapt. Sorry I would have said something if I knew that the approach...
It is just a file that contains values like this:
55
336
56
886
112
20
Like that and then stores those values to an array
I think I plan to read them in as ints.
Can you give me an example of how I would write code to do that?