Search:

Type: Posts; User: Babkockdood

Page 1 of 15 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    7
    Views
    2,826

    Name my Minecraft city

    Hard mode: nothing that ends in "ville".
  2. Replies
    2
    Views
    2,513

    Can I rewind a string like I can a file?

    Think about this. printf, sprintf, and fprintf all work on streams, right? Just like scanf, sscanf, and fscanf work on streams?

    When I use a function like rewind() or fseek() with SEEK_END, it...
  3. Replies
    6
    Views
    1,354

    Like Jim said, %d is used with integers. Use %f...

    Like Jim said, %d is used with integers. Use %f in the final two printf statements, since cir and area are of the type float.

    Let's talk about pi now. First of all, 3.14 is not an integer. It is a...
  4. That worked, thanks.

    That worked, thanks.
  5. scanf("%[^\n]", s->name) does the same thing.

    scanf("%[^\n]", s->name) does the same thing.
  6. [SOLVED] fgets is skipping the second time I call it

    Hey C Board. I created a typedef structure called Student, and I want to pass this structure to two functions, getStudent, to scanf all the members, and printStudent, to print all the members.

    ...
  7. Ok, C Board, what am I doing wrong? (Linked lists)

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

    typedef struct node {
    int value;
    struct node *next;
    } block;

    int main(void) {
    block *root = NULL;
  8. The Windows equivalent of that command is ...

    The Windows equivalent of that command is


    find /V "(ROM_LOAD|ROM_REGION)" your_sourcefile.c
  9. Replies
    6
    Views
    1,517

    Just a suggestion, even though your program...

    Just a suggestion, even though your program technically works like it's supposed to. Make i an integer, use while (i != 8) for the while condition, and replace the two getchars with scanf("%d", &i);...
  10. Replies
    4
    Views
    1,086

    if (mysql_real_connect (conn, opt_host_name,...

    if (mysql_real_connect (conn, opt_host_name, opt_user_name, opt_password, opt_db_name, opt_port_num, opt_socket_name, opt_flags) == NULL)

    Well there's your problem. You're not giving it a host...
  11. Some psuedocode: int main(int argc, char...

    Some psuedocode:


    int main(int argc, char *argv[])

    if argv[1] is null, printf usage message

    argv[1] will be file to be copied

    FILE *in = fopen argv[1], mode "r"
  12. Replies
    4
    Views
    1,086

    Do you have to set up a web server like Apache on...

    Do you have to set up a web server like Apache on localhost first? If so, make sure it's set up properly.
  13. Thanks for all the explanations. I'm starting to...

    Thanks for all the explanations. I'm starting to understand it better.
  14. Explain Object-Oriented Programming Like I'm 5

    I'm an experienced C programmer, but I don't know that much about C++ and I'd like to know why it's better, worse, or just as good.

    I'm probably just ignorant, but to me, I don't see that many...
  15. The double data type is usually eight bytes.

    The double data type is usually eight bytes.
  16. Replies
    8
    Views
    1,701

    Try chdir (http://linux.die.net/man/2/chdir), or...

    Try chdir, or opendir if chdir isn't available. chdir will return -1 if the specified directory doesn't exist. opendir will return NULL if the specified directory doesn't exist.

    Also, you can use...
  17. CommonTater is in the lead.

    CommonTater is in the lead.
  18. Whoever writes the fanciest program gets a cookie.

    Whoever writes the fanciest program gets a cookie.
  19. Replies
    14
    Views
    1,468

    Post the code or quit asking for help.

    Post the code or quit asking for help.
  20. unsigned int iseed = (unsigned int)time(NULL);...

    unsigned int iseed = (unsigned int)time(NULL);
    srand(iseed);

    You don't need a variable for time(NULL). Just replace that with srand(time(NULL));. That while loop is completely unnecessary....
  21. Replies
    14
    Views
    1,468

    The C Board is not a homework machine. ...

    The C Board is not a homework machine.

    Announcements - General Programming Boards

    Try writing the code yourself, and we'll tell you what's wrong with it.
  22. Replies
    18
    Views
    6,759

    a. The odds of it being EOF are incredibly slim,...

    a. The odds of it being EOF are incredibly slim, and b. Why doesn't he just assign it to 0?
  23. Replies
    12
    Views
    2,024

    Maybe this wouldn't work in this case, but I've...

    Maybe this wouldn't work in this case, but I've always used fgets(str, sizeof(str), stdin) to get strings from stdin.

    And your main function should look like this:


    int main(void) {
    //...
  24. Just curious, why wouldn't your compiler include...

    Just curious, why wouldn't your compiler include string.h? It's apart of the standard C library, and all of those headers should be installed by default.
  25. Replies
    18
    Views
    6,759

    Take out the scanf statement, and assign data to...

    Take out the scanf statement, and assign data to getchar() inside the while conditional.


    #include <stdio.h>

    int main(void) {
    int data;
    while ((data = getchar()) != EOF)
    ...
Results 1 to 25 of 363
Page 1 of 15 1 2 3 4