Search:

Type: Posts; User: wintellect

Search: Search took 0.01 seconds.

  1. Thread: C Mysql Api

    by wintellect
    Replies
    8
    Views
    1,859

    hint: int mysql_query(MYSQL *mysql, const...

    hint:


    int mysql_query(MYSQL *mysql, const char *query)

    Executes the SQL query pointed to by the null-terminated string query. Normally, the string must consist of a single SQL statement and...
  2. Replies
    4
    Views
    6,306

    hmm, I was always taught that an application's...

    hmm,

    I was always taught that an application's stack started at the very end of the available application RAM, and worked its way down into the dynamically available memory
  3. Replies
    4
    Views
    1,937

    try this: all: birthdays birthdays:...

    try this:


    all: birthdays

    birthdays: birthdays.o
    gcc -o birthdays birthdays.o

    birthdays.o: birthdays.c birthdays.h
    gcc -c birthdays.c
  4. Replies
    4
    Views
    1,280

    you need to declare "d" as an int before you can...

    you need to declare "d" as an int before you can use it ;)

    And this bit needs to be re-written


    for(count = "%d", start; count <= "%d", end; count++)

    printf("%d");
  5. Replies
    11
    Views
    2,628

    Personally, I would have your function return 0...

    Personally, I would have your function return 0 when the char is a digit and -1 on error

    ...but this is probablyon a personal thing
  6. Thread: seg fault

    by wintellect
    Replies
    2
    Views
    1,611

    Where is the pointer "menu" created? All I see is...

    Where is the pointer "menu" created? All I see is it's being passed to functions and a comparison being made
  7. Thread: Functions?

    by wintellect
    Replies
    13
    Views
    1,634

    functions need to be independantly created -...

    functions need to be independantly created - outside of other functions. main() is a function itself and is the default function started by running the program.

    To create a function called "foo"...
  8. Replies
    6
    Views
    1,916

    You could use a switch() statement to check the...

    You could use a switch() statement to check the contents of ch, and if it's below a certain ASCII character value print something else instead ;)
  9. Replies
    14
    Views
    2,417

    And straight from the man page malloc(3): ...

    And straight from the man page malloc(3):



    I love UNIX for the online documentation :)
  10. Thread: display

    by wintellect
    Replies
    1
    Views
    1,038

    printf() would be your friend here. You can use...

    printf() would be your friend here. You can use justification with it.

    And your question sounds a bit homework-ish...
  11. Replies
    5
    Views
    1,751

    IMHO you're just starting C, so don't worry about...

    IMHO you're just starting C, so don't worry about GUIs at the moment. Get to grips with the concepts that the book you bought is presenting (I have that book too)!

    When you feel ready, may I...
  12. Replies
    14
    Views
    12,737

    free(3) returns memory space allocated by...

    free(3) returns memory space allocated by malloc(3) and the like back to the OS, this does NOT mean it blanks out the memory.

    What you're reading is the contents of the memory location pointed to...
  13. Replies
    14
    Views
    12,737

    How many of the nodes are you trying to remove? ...

    How many of the nodes are you trying to remove?

    All of them?
  14. Replies
    2
    Views
    10,119

    Your if() statement should test as follows: ...

    Your if() statement should test as follows:


    if(type != 's' && type !='u' && type != 'f')
  15. Replies
    8
    Views
    1,767

    Think of it like this, balance has to be reduced...

    Think of it like this, balance has to be reduced by an amount (probably the withdrawl amount). Then you can test if balance is 0 or less and take appropriate action.

    Yes, an if() statement is...
  16. Replies
    3
    Views
    1,131

    You could try this: make empty entries a NULL,...

    You could try this:

    make empty entries a NULL, then malloc memory and copy non NULL chars to the malloc'd memory one-by-one
  17. Replies
    3
    Views
    943

    something like this: #include ...

    something like this:


    #include <stdio.h>

    int mysub(FILE *ptr);

    int main(void)
    {
    FILE *ptr;
  18. Replies
    8
    Views
    1,767

    I see nowhere in your code where balance will get...

    I see nowhere in your code where balance will get to 0

    You never change the value of balance - so how can it reach zero?
  19. Replies
    7
    Views
    1,907

    you could also lookup the ascii value for the...

    you could also lookup the ascii value for the character '>' and use that instead in the comparison
  20. Replies
    8
    Views
    1,767

    the only test against balance I see is here: ...

    the only test against balance I see is here:


    if (withdrawal[x] > balance + deposit[x])
    {
    printf ("***Withdrawal amount exceeds current balance. Please re-enter!***\n");
    withdrawal[x]...
  21. perhaps you could try to wrap them all in one...

    perhaps you could try to wrap them all in one function (untested code):



    llnode *head = NULL;

    void create_list()
    {
    llnode *tmp;
    llnode *ptr;
  22. Replies
    19
    Views
    5,346

    I've always wanted to know: Is it better to...

    I've always wanted to know:

    Is it better to store financila data as a float: eg. 19.99
    or as an int: eg 1999

    (both values are to represent the same some of money)

    Which would be better to...
  23. Replies
    7
    Views
    2,922

    Indeed it does - even the examples are C based:...

    Indeed it does - even the examples are C based:
    http://www.gtk.org/tutorial/c58.html#SEC-HELLOWORLD
  24. Replies
    2
    Views
    2,632

    Far be it for me to do someone's homework, but it...

    Far be it for me to do someone's homework, but it seems your being asked to do use a binary tree instead of a linked list.

    Binary trees increase the speed of searches by halving the number of...
Results 1 to 24 of 25