Search:

Type: Posts; User: BB89

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    4,046

    To free up the memory would I do it like this? ...

    To free up the memory would I do it like this?



    double*dPtr = new double[numEntries];
    delete [] dPtr;


    And this is what is supposed to be done.
  2. Replies
    6
    Views
    4,046

    Printing out Array Elements

    I am trying to print out the array elements while using pointers.

    My Code:


    #include <iostream>
    using namespace std;

    int main()
    {
  3. Replies
    7
    Views
    4,769

    It works but am I supposed to have two cout

    It works but am I supposed to have two
    cout << "Enter a number: " << endl;
    cin >> find_min; and
    cout << "Enter a number: " << endl;
    cin >> num;




    #include <iostream>
  4. Replies
    7
    Views
    4,769

    I think I might be on the right track. ...

    I think I might be on the right track.



    #include <iostream>
    using namespace std;

    int min(int find);

    int main()
  5. Replies
    7
    Views
    4,769

    Finding the Minimum using a function

    I need some help using functions. I wrote this code as if it was a regular program.



    #include <iostream>
    using namespace std;

    int main()
    {
  6. Thread: Repeated addition

    by BB89
    Replies
    22
    Views
    12,103

    Ok, I got it now. Thanks to everyone that...

    Ok, I got it now.

    Thanks to everyone that helped me.
  7. Thread: Repeated addition

    by BB89
    Replies
    22
    Views
    12,103

    Ahh, I have one last question. When I input A...

    Ahh, I have one last question.

    When I input A as 0 it prints out "The result is: 0" as it should. But when I input B as 0 it stops. Should it print out "The result is: 0"?
  8. Thread: Repeated addition

    by BB89
    Replies
    22
    Views
    12,103

    I think I am on the right track now. Now...

    I think I am on the right track now.



    Now my code


    #include <iostream>
    using namespace std;
  9. Thread: Repeated addition

    by BB89
    Replies
    22
    Views
    12,103

    Yes, I can use a while loop.

    Yes, I can use a while loop.
  10. Thread: Repeated addition

    by BB89
    Replies
    22
    Views
    12,103

    I did say that I couldn't use a 'for loop'. ...

    I did say that I couldn't use a 'for loop'.



    I going to work on it, in our class we have to write algorithms before we can even think about code. I am in my first programming class.
  11. Thread: Repeated addition

    by BB89
    Replies
    22
    Views
    12,103

    I cannot use a 'for loop' but I can use a 'do...

    I cannot use a 'for loop' but I can use a 'do while loop'.
  12. Thread: Repeated addition

    by BB89
    Replies
    22
    Views
    12,103

    Repeated addition

    Write a program which will ask for two integer numbers (a and b). The program will multiply these two numbers, a and b, using repeated addition (CANNOT use multiplication operation) and print out the...
  13. Thread: Printing 2D Array

    by BB89
    Replies
    11
    Views
    10,410

    Ok, understood. Im gonna work on it.

    Ok, understood. Im gonna work on it.
  14. Thread: Printing 2D Array

    by BB89
    Replies
    11
    Views
    10,410

    Ok, one last question. What do you mean when you...

    Ok, one last question. What do you mean when you said



    You are trying to print out a 2D array, as if it were a 1D array.
  15. Thread: Printing 2D Array

    by BB89
    Replies
    11
    Views
    10,410

    Do I need the second for loop? can I do just...

    Do I need the second for loop?

    can I do just one loop

    if i changed the array to array[4][4]



    for( i = 0; i < 4; i++ )
  16. Thread: Printing 2D Array

    by BB89
    Replies
    11
    Views
    10,410

    Printing 2D Array

    I am new to 2D arrays.

    I am trying to print out the array.



    #include <stdio.h>

    int main (void)
    {
  17. Replies
    14
    Views
    3,491

    I figured it out. Thanks for the help.

    I figured it out.

    Thanks for the help.
  18. Replies
    6
    Views
    1,086

    I understand that, I do not want you or anyone...

    I understand that, I do not want you or anyone else to give me the answer.




    I don't inderstand

    found_5 = 1;

    Why do I need it?
  19. Replies
    6
    Views
    1,086

    Bithub: Where does 78 work in on your code? I...

    Bithub: Where does 78 work in on your code?

    I have it saying "5 is in A". What can I add to my code to make it find whether or not 78 is in A?
  20. Replies
    6
    Views
    1,086

    Determining if a number is in an Array

    I am trying see if 5 and 78 are is my array.

    So if x = 5 then "5 in is A" and if x = 78 then "78 is not in A".

    What I have so far:



    #include <stdio.h>
  21. Replies
    14
    Views
    3,491

    Ahh, makes since. So printf("A \ B...

    Ahh, makes since.

    So




    printf("A \ B = {%d}", A[x] );
  22. Replies
    14
    Views
    3,491

    #include int main (void) { int...

    #include <stdio.h>

    int main (void)
    {
    int A[3] = {1, 2, 5};
    int B[4] = {1, 5, 9, 10};

    int x, z;

    for( int x = 0; x < 3; x++ )
  23. Replies
    14
    Views
    3,491

    finding common numbers

    I am trying to find the numbers in the two arrays that are in common.

    Say they are:

    int A[3] = {1, 2, 5};
    int B[4] = {1, 5, 9, 10};

    Answer should say A \ B = {1, 5}
  24. Thread: 1D Arrays

    by BB89
    Replies
    4
    Views
    1,124

    Good question, i am not to sure. I know I need a...

    Good question, i am not to sure. I know I need a loop but I how to incorporate A and B.


    slingerland3g: Yes, I am trying to find what is common in both arrays in this case it is {1, 5}. I not...
  25. Thread: 1D Arrays

    by BB89
    Replies
    4
    Views
    1,124

    1D Arrays

    I am very new to arrays and programming in general.

    Question: Finding the intersection



    #include <stdio.h>

    int main (void)
    {
Results 1 to 25 of 74
Page 1 of 3 1 2 3