Search:

Type: Posts; User: lazyturtle

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    1,632

    Thanks for the help but I have a question about...

    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...
  2. Replies
    4
    Views
    1,632

    Matrices Function

    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,...
  3. Thread: Matrices

    by lazyturtle
    Replies
    5
    Views
    1,311

    I've seen sizeof() already but sorry I forgot to...

    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...
  4. Thread: Matrices

    by lazyturtle
    Replies
    5
    Views
    1,311

    Thanks for helping. :) Yes! I need to assign...

    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...
  5. Thread: Matrices

    by lazyturtle
    Replies
    5
    Views
    1,311

    Matrices

    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}...
  6. Replies
    7
    Views
    1,547

    Thanks! I got it now! Edit: Just a quick...

    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;
  7. Replies
    7
    Views
    1,547

    Thanks for the help. I don't know why but I'm...

    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()...
  8. Replies
    7
    Views
    1,547

    [Newbie] Factorial

    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;
    ...
  9. Replies
    12
    Views
    2,447

    Nvm, got it. Thanks for the help. :)

    Nvm, got it. Thanks for the help. :)
  10. Replies
    12
    Views
    2,447

    Sorry but I have another question. If I use y in...

    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.
  11. Replies
    12
    Views
    2,447

    I've only seen printf(), never std::cout, have no...

    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...
  12. Replies
    12
    Views
    2,447

    oh yes. bad mistake.

    oh yes. bad mistake.
  13. Replies
    12
    Views
    2,447

    Yes, tutorial 5. Example: if(x=5) y=x+3;...

    Yes, tutorial 5.

    Example:

    if(x=5)
    y=x+3;
    printf("y = &#37;f\n",y);

    I don't know how to insert equations into the switch statement. Is that even allowed in the switch statement? To...
  14. Replies
    12
    Views
    2,447

    Switch Statements

    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...
Results 1 to 14 of 14