Search:

Type: Posts; User: 00Sven

Page 1 of 6 1 2 3 4

Search: Search took 0.02 seconds; generated 41 minute(s) ago.

  1. Replies
    8
    Views
    16,932

    printf("Hello\n\nHow are you?\n");'\n' is the...

    printf("Hello\n\nHow are you?\n");'\n' is the newline character.
  2. Thread: Matchstick game

    by 00Sven
    Replies
    7
    Views
    11,871

    if (matchsticks == ) matchsticks=4; else...

    if (matchsticks == )
    matchsticks=4;
    else if (matchsticks;
    What is this supposed to be?
  3. Replies
    9
    Views
    1,658

    Dev-C++

    Dev-C++
  4. Replies
    9
    Views
    1,658

    When you compile C code in Dev-C++ the file...

    When you compile C code in Dev-C++ the file extension must be .c. The default is .cpp so you need to change it. If you leave it as .cpp it will compile as C++. This works most of the time but some...
  5. Thread: make line count

    by 00Sven
    Replies
    7
    Views
    1,810

    Get each line one at a time and then use...

    Get each line one at a time and then use something like strlen() to find the end and go from there.
  6. Replies
    3
    Views
    1,417

    That is how you do it. Make it an array of...

    That is how you do it. Make it an array of structures and then that works. Maybe I dont understand the question?
    ~Sven
  7. Replies
    3
    Views
    1,417

    You can use an array of structures instead of a...

    You can use an array of structures instead of a bunch of structures. Instead of having:
    typedef struct TOTAL_REGS_tag
    {
    REG_TYPE_T SM0;
    REG_TYPE_T SM1;
    ...
  8. Replies
    3
    Views
    1,072

    What about square root or exponents? In math.h...

    What about square root or exponents? In math.h there is a sqrt() function for getting the square root and you can use a loop to do exponents.

    main() returns an integer.
    int main(void)

    You...
  9. Thread: flushing stdin

    by 00Sven
    Replies
    2
    Views
    1,398

    LINK...

    LINKDon't double post.
    ~Sven
  10. Replies
    8
    Views
    2,495

    I will explain. %d is a conversion character for...

    I will explain. %d is a conversion character for printf. It holds the place for a variable which you put in at the end. For example, to print out the value of the variable num, the code would be ...
  11. Thread: Saving code?

    by 00Sven
    Replies
    6
    Views
    1,624

    Just print the information into a file and then...

    Just print the information into a file and then when they open the program again read the information from the file.
    ~Sven
  12. Replies
    2
    Views
    920

    It is a lot easier if you post your C source code...

    It is a lot easier if you post your C source code in .c
    ~Sven
  13. Open the file. With a while loop. ...

    Open the file. With a while loop.
    while(fgetc(file) != EOF)
    {
    count++;
    }~Sven
  14. Replies
    2
    Views
    1,261

    Never use gets. LINK (http://

    Never use gets. LINK Replace it with fgets. LINK

    Just an idea but I am not sure if this is what you need. If it will always be the same locations you can use a structure.
    struct location{
    ...
  15. Replies
    20
    Views
    3,434

    You need to add the -1 after strlen(buffer)....

    You need to add the -1 after strlen(buffer). Arrays start at 0 and not one. Buffer[strlen(buffer)] is out of bounds.
    ~Sven
  16. Replies
    20
    Views
    3,434

    You can always also just do ...

    You can always also just do
    filename[strlen(filename)-1] = '\0'This takes the number of characters in the string and then subtracts one (because arrays start at 0 and not 1) and if the string was...
  17. Replies
    20
    Views
    3,434

    strchr is a function for splitting up a string. ...

    strchr is a function for splitting up a string. It takes a string and a character to look for. When it finds thie character it returns a pointer to that first part of the string. If it does not...
  18. Replies
    20
    Views
    3,434

    There are quite a few errors her so bear with me....

    There are quite a few errors her so bear with me.

    Never use gets. LINK Replace it with fgets. LINK



    What is this??? What is gets supposed to be? I think that you want to check the string...
  19. Replies
    12
    Views
    5,355

    What is wrong with the stat function? ~Sven

    What is wrong with the stat function?
    ~Sven
  20. Thread: GCC Warnings

    by 00Sven
    Replies
    12
    Views
    5,154

    I found a better solution, take sleep out of the...

    I found a better solution, take sleep out of the program. It was pretty pointless in how it was used so now it is gone.
    ~Sven
  21. Replies
    18
    Views
    2,615

    int ch; char array[10]; FILE *in; in =...

    int ch;
    char array[10];
    FILE *in;
    in = fopen("temp.tmp", "r");
    if(in == NULL)
    {
    printf("Error opening file!\n");
    }
    while( (ch = getc(in)) != EOF)
    {
  22. Replies
    7
    Views
    1,578

    Make another array and then just go to the...

    Make another array and then just go to the beginnning of the linked list and put the string into the array with sprintf. Next loop through the list using strcat to add each string to the end.
    ~Sven
  23. Replies
    6
    Views
    1,308

    I thought that I had corrected that but I must...

    I thought that I had corrected that but I must have forgotten to. You are right response should be an int not a char.
    ~Sven
  24. Replies
    6
    Views
    1,308

    I do not refer to the return value of getchar. I...

    I do not refer to the return value of getchar. I simply use it to pause the program. You could take this out of the program but then as soon as they hit y or n it would do the code for that choice...
  25. Replies
    6
    Views
    1,308

    You can use getch it will still have them enter...

    You can use getch it will still have them enter whatever they want. It will only display the character if they enter a y or n. It is pretty complicated though.

    char response;
    printf("Continue?...
Results 1 to 25 of 127
Page 1 of 6 1 2 3 4