Search:

Type: Posts; User: Click_here

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    8
    Views
    184

    I'd be tempted to read the number into an integer...

    I'd be tempted to read the number into an integer (fscanf/%d), and then use fprintf with a format specifier (%05s)
  2. Replies
    10
    Views
    167

    false => 0 true => everything else.

    false => 0
    true => everything else.
  3. Replies
    6
    Views
    158

    All ideas are welcome :)

    All ideas are welcome :)
  4. Replies
    4
    Views
    143

    This is a 3 element array of pointer to ints ...

    This is a 3 element array of pointer to ints

    Used like this...


    int *a[3]; /* Notice that the * is usually put next to the variable name */
    int x,y,z;
    x = 1;
    y = 2;
    z = 3;
  5. Replies
    2
    Views
    229

    I'm a bit after your time, but I came back after...

    I'm a bit after your time, but I came back after a few years off.
    Salem is still going strong, but I haven't seen the others for a while...

    I usually only check the C and C# pages, which can be...
  6. Replies
    7
    Views
    212

    Keep the paranthesis for macros - for more on...

    Keep the paranthesis for macros - for more on macros see Tutorials - C Preprocessor Tricks - Cprogramming.com
  7. Remember that strdup is not standard C and may...

    Remember that strdup is not standard C and may not work on all environments :)
  8. Replies
    5
    Views
    176

    Integer promotion still takes place, just earlier.

    Integer promotion still takes place, just earlier.
  9. char c; int j=0; while((c = fgetc(fIN)) !=...

    char c;
    int j=0;
    while((c = fgetc(fIN)) != EOF){

    "c" should be declared an int

    What you have done is similar to this FAQ: Question 12.1
  10. Replies
    5
    Views
    176

    Declare "total" as a float instead of an int

    Declare "total" as a float instead of an int
  11. Replies
    2
    Views
    191

    Getting more range is going to be an electronics...

    Getting more range is going to be an electronics project.

    You need to make either an SMA or N-type connector and match the output to 50 ohms at bluetooth frequency (2.400 to 2.485 GHz). Use a...
  12. PRINT_IF_TRUE... I'd like to see what you are...

    PRINT_IF_TRUE...

    I'd like to see what you are doing there :)
  13. Replies
    7
    Views
    321

    It's better to ask the user what they want to do...

    It's better to ask the user what they want to do now.


    This should get your started - Basically loop until the user enters 'r' to reset, or q for quit




    printf("\nsorry you need to...
  14. Replies
    7
    Views
    321

    if(count>=2) { ... } else if (count>=4) { ......

    if(count>=2) {
    ...
    } else if (count>=4) {
    ...
    }
  15. It's those sort of assumptions that people look...

    It's those sort of assumptions that people look for.

    Remember, just because we can't think of a way someone can access the programme, doesn't mean someone else can't.

    An example of this is when...
  16. It's a security weakness. See Denial of...

    It's a security weakness.

    See Denial of Service here
  17. Like in post 2...

    Like in post 2...
  18. No worries - Is rstanley...

    No worries - Is rstanley's answer sufficiant? Returning a caculated value is the way that you'd usually do it, rather than passing a pointer into a function. Passing a pointer into a function is...
  19. You don't have to save a copy of the value if you...

    You don't have to save a copy of the value if you don't want to.


    Because of the way you are using incValue, I'm guessing that you don't want to return the value of "val".


    Also, you can use...
  20. There is nothing wrong with using conio.h if you...

    There is nothing wrong with using conio.h if you are aware that it won't work outside of windows and you don't intend it to. When it comes to writing code for command prompt on Windows, it's...
  21. Oh I see - You are not checking for EOF... ...

    Oh I see - You are not checking for EOF...



    #include <stdio.h>

    int main(void)
    {
    int ch;
    char buf[BUFSIZ];
  22. If you are using Windows you can use conio.h - >...

    If you are using Windows you can use conio.h - > kbhit()

    On Windows it is really easy to see if something is on stdin before trying to read




    #include <conio.h>
    ...
    if (kbhit())
  23. Replies
    3
    Views
    430

    Have a look at the ptrdiff_t type

    Have a look at the ptrdiff_t type
  24. The easiest way is to use sscanf into a char...

    The easiest way is to use sscanf into a char array, and then fputs - That way you can reuse a lot of that code.

    Your scanf's from the file will also need to change, because you are now reading...
  25. Niccolo should have used C code for a C forum,...

    Niccolo should have used C code for a C forum, not C++...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4