Thanks for the help but I have a question about the pointers. I'm starting to use malloc and calloc so I'm wondering if this is the correct way of doing it--because I've run into errors while...
Type: Posts; User: lazyturtle
Thanks for the help but I have a question about the pointers. I'm starting to use malloc and calloc so I'm wondering if this is the correct way of doing it--because I've run into errors while...
I have another noob question about matrices, again.
Say I have a matrix A and a vector b. I want to create a function that will give me a new matrix C = A*A and also in the same function,...
I've seen sizeof() already but sorry I forgot to tell you that x and y are both one dimensional array. I tried to modify what you gave me, however, it's not working. I'm still getting the same...
Thanks for helping. :)
Yes! I need to assign y to x for the next loop. And yes, they're arrays. But is there another way to do it? I haven't seen memcpy() before so I don't know if that's...
Hi,
I'm working on multiplying matrices for homework and I'm stuck for a long time. This is my assignment:
{x}(n+1) = [K] {x}(n), n = 0,1,2, ... ,8,9.
In other words, the next vector {x}...
Thanks! I got it now!
Edit: Just a quick question but is it possible to put m = 2n; like this:
double mfact(int m)
{
m = 2n;
if(m==2)return 2;
Thanks for the help. I don't know why but I'm still getting the wrong answer because when I entered in 2, I get 48 when I'm supposed to get 24.
#include <stdio.h>
double mfact(int);
main()...
Hi, I'm doing my homework and I'm stuck on this factorial part. I know this is the code for n! from my text:
#include <stdio.h>
double mfact(int);
main()
{
int m;
...
Nvm, got it. Thanks for the help. :)
Sorry but I have another question. If I use y in the switch statement, then I'd identify it in the beginning as:
double y;
right?
Because for some reason, all my ys are zeros now.
I've only seen printf(), never std::cout, have no idea why.
Add the results from each case. Like if I calculate:
y (case 1) to be = 5
y (case 2) = 4
y (case 3) = 3
Then when I do the...
oh yes. bad mistake.
Yes, tutorial 5.
Example:
if(x=5)
y=x+3;
printf("y = %f\n",y);
I don't know how to insert equations into the switch statement. Is that even allowed in the switch statement? To...
Hi,
I'm a beginner and lost on my assignment already--stuck on the switch statements. I've looked at the tutorials already but I still can't find my answer so I'm here. My assignment is a quiz...