I have never worked with vectors, is there a way to fix my add function while still using an array? maybe something using const
Type: Posts; User: ashleyd
I have never worked with vectors, is there a way to fix my add function while still using an array? maybe something using const
//histogram.h
#pragma once
class histogram
{
public:
histogram(void);
histogram(int numCount);
~histogram(void);
void histogram::add(int numGenerated);
void...
//main.cpp
#include "aRandomNumber.h"
#include "histogram.h"
int main()
{
aRandomNumber die1();
histogram histogram1(die1.getRange());
for (int i=0; i<10; i++) //calls the add function...
main.cpp:
#include "aRandomNumber.h"
#include "histogram.h"
int main()
{
aRandomNumber die1 = new aRandomNumber();
histogram histogram1 = new histogram();
for (int i=0; i<10; i++) //calls...
Thanks for the advice, I was able to get it working by putting a return; statement after each fprintf statement
Sorry about that, I didn't read your last post untill after I posted my last post
I did read the link you provided me with, and I did edit my code
my new edited code is:
void...
Yeah this is a duplicate by mistake, caused by slow page loading
so any ideas of what i can do to fix this?
i am trying to print out an equation, in the form a + bi
I am working on a function for my project that formats the output of complex(imaginary) numbers, but when I run it, its not being formatted as i thought it would be.
the struct being used is:
...
I am working on a function for my project that formats the output of complex(imaginary) numbers, but when I run it, its not being formatted as i thought it would be.
the struct being used is:
...
When i ran that simple program i got:
0.000000 2.000000
Given:
main.c
/**************************************/
/* main.c */
/* DO NOT MODIFY THIS FILE */
/**************************************/
#include...
I replaced the %d's with %lf's, and now for the output function errors i am getting:
Output Function Errors:
expected: 1 + 2i
actual: 1.000000 + 2.000000i
expected: 1 + 2i
actual: 1.000000 +...
I am working on a function for my project that formats the output of complex(imaginary) numbers, but when I run it, its not being formatted as i thought it would be.
the struct being used is:
...
is there a way for me to find out exactly what the outf file handle does, because after looking at my documentation it says that the outf writes output to the stream pointed to by outf, which did not...
I am currently working on a project, and am having trouble understanding part of the code
A section of this code is:
complex input_complex(FILE *infile)
{
complex z = {0,0};
double re = 0,...