Search:

Type: Posts; User: rculley1970

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,641

    That actually worked. Let me see if I can adjust...

    That actually worked. Let me see if I can adjust my actual program. Thank you.
  2. Replies
    5
    Views
    1,641

    Friend Functions

    I am having problems with something that should be simple. Just trying to initialize a member variable and then use a friend function to display the private member variable. As you can see, I pass...
  3. Replies
    13
    Views
    22,554

    I appreciate everyones help, I just got on and am...

    I appreciate everyones help, I just got on and am looking at the help and working on it now. I don't want to go too far into explaining since it is for a class so I just want hints provided as I...
  4. Replies
    13
    Views
    22,554

    Unfortunately I cannot have any variables or...

    Unfortunately I cannot have any variables or arrays declared in the main() function. The only thing I can use in main are the function calls. I also don't understand how arr[5] can be declared for...
  5. Replies
    13
    Views
    22,554

    I am putting the funtions before main(), only the...

    I am putting the funtions before main(), only the function calls are being put into main(). I get the error:

    error C2109: subscript requires array or pointer type

    for my array in the second...
  6. Replies
    13
    Views
    22,554

    int array (int size, int i) { int a[5];...

    int array (int size, int i)
    {
    int a[5];
    printf(" enter the 5 elements for the array.\n");
    for (i = 0; i <= 4; i++)
    {
    scanf("%d ", &a[i]);
    }
    printf("%d, %d, %d, %d, %d\n", a[0], a[1],...
  7. Replies
    13
    Views
    22,554

    Multiple functions

    I am trying to create a program with multiple functions before the main function. I am trying to use an array and use the element data in all the different functions but I am getting an error saying...
  8. Thread: loop

    by rculley1970
    Replies
    13
    Views
    1,679

    Thank you for everyones help. I finally figured...

    Thank you for everyones help. I finally figured out all the bugs and got it working just right. And just in time.
  9. Thread: loop

    by rculley1970
    Replies
    13
    Views
    1,679

    Is there something I am missing? I can't seem to...

    Is there something I am missing? I can't seem to find the issue.



    float count, num, sum, average;
    int n, op;
    printf("please enter your numbers: \n");

    do {
  10. Thread: loop

    by rculley1970
    Replies
    13
    Views
    1,679

    FINALLY figured it out. but it sorta messed up...

    FINALLY figured it out. but it sorta messed up some other function within the program. I was able to put things into a do-while loop with 'getchar'. still working on it. Didn't have to use...
  11. Thread: loop

    by rculley1970
    Replies
    13
    Views
    1,679

    that code only displays the number you type in. ...

    that code only displays the number you type in. if you type in a letter, it will only show 0.00 and end the program. If you look at the original code I posted, you will see that it is an infinite...
  12. Thread: loop

    by rculley1970
    Replies
    13
    Views
    1,679

    That is quite advanced to what I should be using...

    That is quite advanced to what I should be using right now. As far as I was told by one instructer, I should be using the 'getchar' command. Isn't there are more simple way of doing this?
  13. Thread: loop

    by rculley1970
    Replies
    13
    Views
    1,679

    This program is for a class so I do not want the...

    This program is for a class so I do not want the exact answer. I would greatly appreciate a nudge in the right direction though. I have tried to put the "getchar" command in but had no success. ...
  14. Thread: loop

    by rculley1970
    Replies
    13
    Views
    1,679

    I looked into this and understand that it is the...

    I looked into this and understand that it is the getchar command. But I have tried several ways of doing it but cannot seem to get it to work right. I have a program that is supposed to accept...
  15. Thread: loop

    by rculley1970
    Replies
    13
    Views
    1,679

    loop

    Is it possible to create a do-while loop to restrict input to numbers only and not letters?
  16. Thread: Counting

    by rculley1970
    Replies
    8
    Views
    1,328

    Thank you CWR, the hint helped and i figured it...

    Thank you CWR, the hint helped and i figured it out. here is the code:


    #include <stdio.h>
    main()
    {
    float n, average = 0, count = 0, sum = 0.0;
    printf("This program averages grades.\n");...
  17. Thread: Counting

    by rculley1970
    Replies
    8
    Views
    1,328

    thank you, let me work on it.

    thank you, let me work on it.
  18. Thread: Counting

    by rculley1970
    Replies
    8
    Views
    1,328

    Here is the code that i came up with to input...

    Here is the code that i came up with to input some numbers and then try to average them. The only problem i really have right now is how to count the loops so i can divide it as an average.


    ...
  19. Thread: Counting

    by rculley1970
    Replies
    8
    Views
    1,328

    Counting

    I am trying to figure out how to count loops to do an average of numbers input. It is a lab for a college class so I will accept only hints if neccessary. I can use a "while" statement to accept...
Results 1 to 19 of 19