Search:

Type: Posts; User: wagman

Search: Search took 0.00 seconds.

  1. Replies
    2
    Views
    1,961

    rand() to choose?

    If I have a function like select(int a, int b, int c) how can I use the rand() to select a, b or c and then return that value? ie.. if a=30, b=40 and c=50 how can i use rand() to just pick b and...
  2. Thread: pointer

    by wagman
    Replies
    3
    Views
    1,103

    sorry about the paste job. all this program does...

    sorry about the paste job. all this program does is take input and capitalize it and keep track of the number of characters and letters. Lot of code to do something simple.

    if(process(&c,...
  3. Thread: pointer

    by wagman
    Replies
    3
    Views
    1,103

    pointer

    how would i go about removing the pointers from this function?

    int process(int *p, int *nchars_ptr, int *nletters_ptr)
    {
    static int cnt = 0, last_char = ' ';

    if(isspace(last_char) &&...
  4. Thread: a diamond

    by wagman
    Replies
    5
    Views
    1,944

    nm..got it :)

    nm..got it :)
  5. Thread: a diamond

    by wagman
    Replies
    5
    Views
    1,944

    I don't understand what you mean by N-i spaces...

    I don't understand what you mean by
    N-i spaces on a line" ?
  6. Thread: a diamond

    by wagman
    Replies
    5
    Views
    1,944

    > for (i = 1;i

    > for (i = 1;i <= N; i+=2) {
    Perhaps
    for (i = N;i >= 1; i-=2) {

    right, but im stuck on trying to get the triangles to go in the opposite direction so as to complete the diamond. so far i have...
  7. Thread: a diamond

    by wagman
    Replies
    5
    Views
    1,944

    a diamond

    We have to create a diamond that is centered on the screen using this code that creates a triangle. My thought process has been to use 4 right triangles to create the diamond. What im stuck on is...
Results 1 to 7 of 7