Search:

Type: Posts; User: danieldcc

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    838

    Pointer as an array name - help

    I'm having a hard time grasping this code



    #define N 10
    int a[N], i, sum = 0, *p = a;
    for (i = 0; i < N; i++)
    sum += p[i];
  2. Replies
    2
    Views
    7,558

    how about using for(;;) instead of the...

    how about using


    for(;;)

    instead of the while loop
  3. Replies
    7
    Views
    874

    right, but I'm trying to avoid using the "==...

    right, but I'm trying to avoid using the "== somevalue" that you have there

    so how do I return false if values from 0 to 100 are true and I still want to use if(myfunction()) without the == part...
  4. Replies
    7
    Views
    874

    but then how would int delete (struct...

    but then how would

    int delete (struct data_node **, int);

    if(delete(&first, data)) //so how would this determine if I want to return value of int 0 as in TRUE, or just return 0 for FALSE?
  5. Replies
    7
    Views
    874

    so basically a = 0; return 0; is different...

    so basically
    a = 0;

    return 0;
    is different from
    return a;
    ?
  6. Replies
    7
    Views
    874

    Explanation of return

    if i'm returning an int from a function and I want to return 0...why does this work

    return (0); --> for false

    return a; --> if a equals 0, return is still true and works fine but i don't know...
  7. Wow, great, I think some of this stuff is finally...

    Wow, great, I think some of this stuff is finally starting to sink in...thank you.
  8. easy question but bugging me on declaring structs

    // Return the number of nodes in a list (while-loop version)
    int Length(struct node* head) {
    int count = 0;
    struct node* current = head;
    while (current != NULL) {
    count++;
    current =...
  9. Replies
    4
    Views
    2,190

    yep got it. tks

    yep got it. tks
  10. Replies
    2
    Views
    1,300

    return array position from function

    Hey, I'm trying to return the position of the array so I can print the contents of a structure at that position, I run in to the problem of what if the array position is 0? This is a problem cause I...
  11. Replies
    4
    Views
    2,190

    hhmmmm i changed function name and worked, now i...

    hhmmmm i changed function name and worked, now i changed function name back and works again? wtf? i'm using cygwin, is there a bug?
  12. Replies
    4
    Views
    2,190

    passing structure to function

    Anyone know why I can't pass the structure to the function this way????



    #include <stdio.h>
    #include <string.h>


    void diplay_jock(athlete players) {
  13. Replies
    8
    Views
    1,969

    I took salem's advise and got it working...

    I took salem's advise and got it working perfectly




    char *end = str + strlen(str);
    while ((temp = strchr(temp, value1)) != NULL && (temp +2) < end)


    Now, another part of questions asks...
  14. Replies
    8
    Views
    1,969

    Ok. cool...that looks like a better way of...

    Ok. cool...that looks like a better way of doing....for my learning curve though, do you know why what I didn't doesn't work?
  15. Replies
    8
    Views
    1,969

    pointer arithmetic

    Ok. so I'm writing up the below assignment and have a little snag in the code
    • takes command line arguments of one string and two single characters
    • locates the first character in the string: if...
  16. Replies
    2
    Views
    1,132

    ok i think i got it. this is right? right? ...

    ok i think i got it. this is right? right?



    #include <stdio.h>
    #include "max_sizes_b.h"

    int main (void) {

    int A[MAX_L][MAX_N], B[MAX_M][MAX_N], C[MAX_L][MAX_N], i, j, l, m, n;
  17. Replies
    2
    Views
    1,132

    no, wait, I think something is wrong with my...

    no, wait, I think something is wrong with my code......let me work on it some more
  18. Replies
    2
    Views
    1,132

    multiplying matricies

    so I think everything is good in my code, except when i print I get a few funny numbers. I think because the numbers are too big to be integers. How do I effectively convert them to show up properly...
  19. Replies
    10
    Views
    7,599

    ah, pointer stuff is a little confusing, but...

    ah, pointer stuff is a little confusing, but thanks for the help....



    #include <stdio.h>

    void test(int *p) {


    *p = 20;
  20. Replies
    10
    Views
    7,599

    quick and easy passing pointers question

    Just testing and getting warnings. Still compiles but not sure why warning?



    #include <stdio.h>

    void test(int *p) {
    int a = 20;

    *p = &a;
  21. No closer to a solution? I got my solution...

    No closer to a solution? I got my solution already I believe.



    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>

    #define ROWS 10
    #define COLS 10
  22. tks quzah

    tks quzah
  23. Replies
    4
    Views
    1,576

    hahahhahahahahaahah, lol, i'm an idiot!!! tks

    hahahhahahahahaahah, lol, i'm an idiot!!!

    tks
  24. Replies
    4
    Views
    1,576

    think that i'm getting this wrong but from what i...

    think that i'm getting this wrong but from what i understand this means.....

    the value is true as long as ch does not equal '.' or '!' or '?'
  25. Replies
    4
    Views
    1,576

    Simple question on while loops

    why does this work


    printf ("Please enter a sentence");
    while ((ch = getchar()) != '.') { //i know that '\n' would terminate on new line character
    if (ch == '.' || ch == '!' || ch == '?') ...
Results 1 to 25 of 49
Page 1 of 2 1 2