Search:

Type: Posts; User: winggx

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    7
    Views
    1,515

    Perherps my teahcer wants us to learn pointer in...

    Perherps my teahcer wants us to learn pointer in this way...
  2. Replies
    7
    Views
    1,515

    how about this line of code?...

    how about this line of code?
    myNode->thirdNode->firstNode = myNode;

    is this right? or should it be
    myNode->thirdNode->firstNode = myNode->thirdNode ?
  3. Replies
    7
    Views
    1,515

    so you mean i should have myNode = malloc(sizeof...

    so you mean i should have myNode = malloc(sizeof (triNode));
  4. Replies
    7
    Views
    1,515

    need some help with this pointer structure

    http://i15.photobucket.com/albums/a396/winggx/midterm.jpg


    The link above is the pointer structre I need to create
    The following is the code I wrote



    struct triNode
    {
  5. Replies
    2
    Views
    1,281

    A question about structure and array

    Suppose I have the following structure and array.


    typedef struct name {

    char firstName[20];

    char lastName[20];

    } name
  6. Replies
    10
    Views
    7,896

    Can large can an int hold?

    Just a quick question, how large can an int hold?

    Is it between -999999999 and 999999999?

    does this work?

    int num = 999999999 + 1;

    thx
  7. Some basic questions about text editor and compiler

    so I have been working with C for 4 months now (not so long)

    but I am still confused about how to compile a C program..
    I am using a mac, and so far I wrote my codes with Xcode, and then I type...
  8. Replies
    9
    Views
    2,956

    comparing two strings

    I want to compare two strings and see if they are the same or not



    char myString[]="hello";

    if (myString == "hello") {

    printf ("same\n');
  9. Replies
    1
    Views
    1,718

    some questions about scanf

    I wrote something like this:



    int main () {

    char input[5];

    scanf ("%c" , input);
    scanf ("%c" , input);
  10. Replies
    5
    Views
    966

    So, instead of scanf("%s\n,input), I need to use...

    So, instead of scanf("%s\n,input), I need to use %c?
    and what size of char input[] should I use inside the bracket..?

    Would you mind if you can give me an example..?

    oh...and I am not allowed...
  11. Replies
    5
    Views
    966

    A question about inputting a string

    If I need to write a program that reads a string (a person's name)
    then print out the first five characters of the name, how can i do that?

    for example:
    johnny will output johnn

    this is what...
  12. Thread: input in C?

    by winggx
    Replies
    6
    Views
    1,370

    But I need to know when the user has done...

    But I need to know when the user has done inputting....
    if i dont do EOF checking, is there another way to know the user has finished inputting?
  13. Thread: input in C?

    by winggx
    Replies
    6
    Views
    1,370

    sorry, the code I posted was wrong... It should...

    sorry, the code I posted was wrong...
    It should be



    int main () {
    char c[21];

    while (scanf("%c\n",c) != EOF) {
  14. Thread: input in C?

    by winggx
    Replies
    6
    Views
    1,370

    input in C?

    Is there something wrong with my code?
    I am quite confused about inputing a string and a character...



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

    int main () {
    int c[21];
  15. Replies
    6
    Views
    1,298

    A question about string

    If I have a string like this:

    char myString [5];

    But I didn't put any characters into the array
    does it mean:

    myString [0] = '\0'
    myString [1] = '\0'
    myString [2] = '\0'
  16. Replies
    1
    Views
    1,516

    is a string in C = pointer = array?

    If I have a function that consumes a string,
    for example,



    void myFunction (char *s) {

    ...

    }
  17. Replies
    2
    Views
    1,274

    having trouble to print helo world....

    I am using a mac, and I wrote a simple code using Xcode



    #include <stdio.h>
    int main () {
    printf ("hello world\n");
    return 0;
    }
  18. Replies
    5
    Views
    2,351

    some basic question about C

    what is the difference between the two:


    int main (void)
    {
    return 0;
    }

    and
  19. Replies
    1
    Views
    2,059

    Some questions about left perfect tree

    I am learning about binary search tree now.
    But I have some trouble understanding what a left perfect tree is.
    In my homework assignment, it states this:

    A left perfect tree (LPT) is a binary...
  20. ok, thank you very much... finally i solved my...

    ok, thank you very much...
    finally i solved my problem, really thx.....

    but can someone kindly give me some hints of what a left perfect tree is?

    A left perfect tree (LPT) is a binary search...
  21. Need some help with inserting an element into a tree

    I have to make a destructive function, called insertbst that allows a user to insert an element into a binary search tree...

    here is my code


    struct node * bstinsert (struct node *s , struct...
  22. Thank you very much. I understand it now. I have...

    Thank you very much. I understand it now.
    I have one more questinn though.

    Is it ok if I just use if statement?
    I am kind of confused the difference between if and else if...
    this is my...
  23. Thanks, it makes more sense to me now. But...

    Thanks, it makes more sense to me now.
    But hum... even I add return to my first and second statement, is it true that my code is still wrong?

    Because the code testing system of my school says it...
  24. I don't understand 13... what does it mean by go...

    I don't understand 13...
    what does it mean by go back to the first call?
    isn't the function will end after it returns a value?

    (**sorry, i am new to C, really appreciate your help)
  25. I still don't quite get it... I understand the...

    I still don't quite get it...
    I understand the return word makes the difference...but why?
    I tried to trace my code, but I can't see what the problem is..
    when int i is given, it has to be bigger...
Results 1 to 25 of 32
Page 1 of 2 1 2