Search:

Type: Posts; User: ^xor

Page 1 of 8 1 2 3 4

Search: Search took 0.01 seconds.

  1. Thread: Large numbers...

    by ^xor
    Replies
    2
    Views
    1,404

    Use a library like GMP (http://www.swox.com/gmp/).

    Use a library like GMP.
  2. Replies
    10
    Views
    1,616

    Use strtok.

    Use strtok.
  3. Replies
    36
    Views
    8,147

    I'd use it if I had Windows, but I can't stand...

    I'd use it if I had Windows, but I can't stand the look and feel of QT in Linux. Firefox 1.5 Beta is just as fast as Opera for me anyway.
  4. Replies
    4
    Views
    1,271

    You forgot to close the comment on line 178... A...

    You forgot to close the comment on line 178... A good editor would've picked it up instantly as the rest of the code would be colored in the comment color.
  5. Replies
    3
    Views
    1,460

    Getting and searching for matching song...

    Getting and searching for matching song information is easy, but queing up the song in your MP3 player could prove difficult unless it has a good command line interface or similar. It's not...
  6. Thread: Wierd Addresses

    by ^xor
    Replies
    4
    Views
    960

    Yes, but it will change if you do something like...

    Yes, but it will change if you do something like this instead:

    signed int array1[10];
    signed int *array_ptr = array1;

    cout<<&array_ptr<<endl;
    ...
  7. Replies
    3
    Views
    7,445

    char string[] = "I_like_peanuts!"; char *p =...

    char string[] = "I_like_peanuts!";
    char *p = string;

    for (; *p; ++p)
    {
    if (*p == '_')
    *p = ' ';
    }
  8. Thread: promming doubt

    by ^xor
    Replies
    5
    Views
    955

    Read the FAQ perhaps?...

    Read the FAQ perhaps?
    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044873249&id=1043284392
  9. Replies
    4
    Views
    862

    #include #include int...

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

    int main(void)
    {
    if (NULL == 0)
    puts("TRUE: NULL == 0");

    if ('\0' == 0)
    puts("TRUE: '\\0' == 0");
  10. Thread: zip codes

    by ^xor
    Replies
    10
    Views
    2,692

    Never use scanf like that. What do you think...

    Never use scanf like that. What do you think happens if someone decides to input 200 characters instead of 31 + nul? That's right, a stack overflow...

    Either use scanf("%31s", ...) or fgets.
  11. Replies
    10
    Views
    3,129

    It's gets() and not get(), and I haven't looked...

    It's gets() and not get(), and I haven't looked closely at your code so I don't know if that's what causing it to break. But the mere presence of it in your code means that your program has a...
  12. Replies
    6
    Views
    2,053

    scanf("%s", name); You've got yourself a...

    scanf("%s", name);

    You've got yourself a buffer overflow there. Use fgets or add a lenght modifier like %99s or something.
  13. Replies
    10
    Views
    3,129

    Didn't anyone tell you to never ever use gets()?

    Didn't anyone tell you to never ever use gets()?
  14. Replies
    29
    Views
    4,979

    But why should you when it's not necessary and...

    But why should you when it's not necessary and simply introduces another point of failure? The reasons for not casting malloc may be weak according to you, but can you give us a single good reason...
  15. Thread: motif programming

    by ^xor
    Replies
    1
    Views
    1,557

    Did you link against the X and motif libs?...

    Did you link against the X and motif libs? -lMotif and -lX11 or something similar.
  16. Replies
    2
    Views
    1,653

    gcc -E

    gcc -E
  17. Replies
    12
    Views
    10,018

    char tin[2]; ... sprintf(tin,"no\0"); You're...

    char tin[2];
    ...
    sprintf(tin,"no\0");

    You're still writing past the array boundary.
  18. Replies
    12
    Views
    10,018

    while(tin == "yes") That's not how you compare...

    while(tin == "yes")

    That's not how you compare strings. Use strcmp or strncmp. Furthermore, tin can never be "yes" since it's only got room for one character plus the nul character. Either make...
  19. Replies
    2
    Views
    21,954

    I just read that extern char **environ is defined...

    I just read that extern char **environ is defined by POSIX while envp (third arg to main) is just something that a lot of implementations support.
  20. Replies
    2
    Views
    21,954

    envp and extern char **environ

    What's the difference between environ and envp? They both seem to do the same thing...

    environ

    #include <stdio.h>
    #include <unistd.h>

    extern char **environ;

    int main(int argc, char...
  21. Replies
    33
    Views
    15,918

    Poll: 8 space tabs all the way. Indentation is meant to...

    8 space tabs all the way. Indentation is meant to make the code more readable, and IMO 4 spaces just isn't enough.

    I also prefer tabs over spaces since it consumes less space (not a big issue...
  22. Replies
    19
    Views
    3,091

    That will work. Salem's point before was that...

    That will work. Salem's point before was that when you assigned the a pointer with a string literal, you lost memory location of the memory you allocated with malloc. Trying to free that now with a...
  23. Thread: inet_aton()

    by ^xor
    Replies
    9
    Views
    19,400

    A quick google search turned up this document:...

    A quick google search turned up this document:
    http://www.fileformat.info/mirror/egff/ch09_04.htm

    Just search for "bit order" within it to see lots of references to different bit orders.
  24. Thread: inet_aton()

    by ^xor
    Replies
    9
    Views
    19,400

    This is quite confusing... So if I have...

    This is quite confusing...

    So if I have received an integer as little endian, on a big endian machine (with big endian bit order), I can't use htonl to convert it to network endian?

    As for the...
  25. Replies
    8
    Views
    7,073

    Ah right, so 'up' moves up one stack frame?...

    Ah right, so 'up' moves up one stack frame? That's good to know. :)
Results 1 to 25 of 188
Page 1 of 8 1 2 3 4