Search:

Type: Posts; User: jack jordan

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Thread: cin to int

    by jack jordan
    Replies
    1
    Views
    2,986

    cin to int

    Hello. I'm going back over some C++ stuff. The following program is the usual way I might get user input into a private member of a class.

    #include <iostream>

    class Account {
    private:
    int...
  2. Modification of or simbiosis with old software

    It has been a while since I last posted, so hello.

    I've studied pretty intensely now for about a year and a half. I've spent about 1000 hours in both C and Java, as well as 500 hours in C++ and...
  3. It seems I was wrong about this. I had assumed...

    It seems I was wrong about this. I had assumed that x would get dereferenced first, but it seems that C's order of operations work differently than I thought they did.

    I believe that this is the...
  4. p and q have been declared as int pointers, so...

    p and q have been declared as int pointers, so when they are incremented or decremented, they move one int space forward or one int space backward. In an example:


    int num[10] = {1, 2, 3, 4, 5,...
  5. I believe scanf looks a bit like this: int...

    I believe scanf looks a bit like this:


    int scanf(int* bird) {
    // read input stream
    // save next int into variable bird
    // return number of items read
    }
    while printf for example...
  6. Replies
    11
    Views
    14,222

    I may not be quite understanding what you are...

    I may not be quite understanding what you are trying to say, but according to your instructions:

    Honestly the two functions part doesn't make sense to me. From what I do understand, your print...
  7. Replies
    11
    Views
    14,222

    I have what I think is some valid criticism for...

    I have what I think is some valid criticism for your code beyond what you have asked for. I think it is a little bit better if you could keep the scope of a variable within the area which it is...
  8. Replies
    11
    Views
    14,222

    I agree :) This is a fun problem though I think....

    I agree :)
    This is a fun problem though I think. I coudln't resist making my own version with deal and print.


    #include <stdio.h>
    #include <time.h>
    #include <stdlib.h>
    #include <string.h>
    ...
  9. Replies
    27
    Views
    10,615

    Are you saying that he has non-ASCII characters...

    Are you saying that he has non-ASCII characters in his code? Is he somehow getting formatting characters or something in a copy-paste? I really have no idea what a stray error is. I've never gotten...
  10. Replies
    27
    Views
    10,615

    if (0 < marks && marks > 40) is the same as: ...

    if (0 < marks && marks > 40)
    is the same as:


    if (marks > 0 && marks > 40)
    in this case, whenever marks is equal or less than 40, this if condition will evaluate to false. It may as well be...
  11. Replies
    6
    Views
    3,353

    Are you saying that the first full moon which...

    Are you saying that the first full moon which occurred in the year 2000 happened in July?

    Or perhaps that is the full moon you chose as your first. Though you did write:


    Full moon calendar.
  12. You can make a header file and include it in...

    You can make a header file and include it in future projects. The header file may have useful functions you would not have to define in future files but could still use.


    Libraries are only...
  13. Replies
    3
    Views
    10,489

    Might the DAQlib.h be a library specifically...

    Might the DAQlib.h be a library specifically built for your online course at coursehero? If not, I am not sure what that is. I think it is important to know though because I believe it is needed for...
  14. Replies
    2
    Views
    4,091

    Finishing learning the C language

    I feel like I am coming up on the end of my C language learning experience. I have spent about 1,000 hours in it for the last six months. I have written about 500 programs. Many of them only took 10...
  15. void display_list() { struct...

    void display_list()
    {
    struct list_collection *temp;
    struct list_collection *previous;
    int c;

    current_list = head_list;
    temp = current_list;

    ...
  16. I realized one second later I was wrong in what I...

    I realized one second later I was wrong in what I said in this post.
  17. You certainly have some interesting code. It is...

    You certainly have some interesting code. It is difficult for me to keep track of where all your pointers are going, and the way you use your structs is different from the way I am used to doing...
  18. Thread: Loop error

    by jack jordan
    Replies
    5
    Views
    2,052

    Before understanding your code I see this: ...

    Before understanding your code I see this:


    /* switch meny */
    int val, i;
    while (val != 6) {
    val does not have any value inside it. In order to compare it correctly, it needs an assignment...
  19. In the real game 21, the dealer never makes any...

    In the real game 21, the dealer never makes any choice as to what options to take. The dealer has to play by specific rules. If your game is similar to 21, then the computer player should be doing...
  20. In the example question you posted, the OP is...

    In the example question you posted, the OP is asking about passing an array to a function. This is a little bit different than your plain array definition.
  21. Replies
    5
    Views
    3,086

    After thinking about this more, I wanted to...

    After thinking about this more, I wanted to correct myself and address the OP's concern more.

    Actually, it is the denominator that approaches max int size, but I don't believe it ever becomes a...
  22. Replies
    5
    Views
    3,086

    Math programs are difficult for me to put down I...

    Math programs are difficult for me to put down I guess. I finished a program which can run a Leibniz series far beyond my computer's ability to process it. I had expected better results though....
  23. Replies
    6
    Views
    3,050

    I didn't actually read your code, so my post...

    I didn't actually read your code, so my post might just be gibbering madness. Sorry about that.

    From what I understand you are trying to concatenate numbers. By your example:
    1. User enters 1,...
  24. Replies
    5
    Views
    3,086

    GReaper gives the best advice on this, but not...

    GReaper gives the best advice on this, but not the most fun advice I think :)

    The following is an example of how you can make your own fraction calculations to hundreds of places if you like. If...
  25. Just a little code criticism: ...

    Just a little code criticism:

    gets(array[i].city);
    Use fgets so you don't try to assign too many characters into the char array.

    fflush(stdin);
    fflush(stdin) is undefined behavior. fflush is...
Results 1 to 25 of 89
Page 1 of 4 1 2 3 4