Search:

Type: Posts; User: mitakeet

Page 1 of 9 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    21
    Views
    5,803

    Memory contents are very poor sources of...

    Memory contents are very poor sources of randomness. In particular, most OSs will zero memory before providing it to a process, which makes the memory non-random in the first place. Second, it is a...
  2. Replies
    19
    Views
    2,209

    The problem with fgets() (and why I didn't use...

    The problem with fgets() (and why I didn't use it) is that if you have lines longer than your buffer you get truncation with the next read being the remainder of the buffer (presuming it is still...
  3. Replies
    19
    Views
    2,209

    This will do what you want, though it is quite...

    This will do what you want, though it is quite sensitive to the format of your input file (it basically requires that there be a linefeed immediately after the last number):



    #include <stdio.h>...
  4. Replies
    19
    Views
    2,209

    All wrong. RTFM scanf before you go much...

    All wrong. RTFM scanf before you go much further!

    Try this (compiled, but not tested):



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

    int main() {
  5. Replies
    38
    Views
    6,457

    It is nice to know that you are a mature adult...

    It is nice to know that you are a mature adult who is capable of carrying on a meaningful debate and not a childish twit who can only be rude and obstructive NOT.

    Instead of a useful comment...
  6. Replies
    38
    Views
    6,457

    When was the last time you read the FAQ you quote...

    When was the last time you read the FAQ you quote so often? Please show me where it specifically address the problem with my code.
  7. Replies
    38
    Views
    6,457

    I agree with your statement and the information...

    I agree with your statement and the information in the FAQ, what I don't agree with is Quzah telling me I am wrong for using feof() and failing to back that statement up. If he is so sure I am...
  8. Replies
    38
    Views
    6,457

    While you certainly have an argument for a...

    While you certainly have an argument for a logical flaw in counting the number of lines, I still fail to see how my code is incorrect if you were to look at it in isolation. If you simply want to...
  9. Replies
    8
    Views
    2,029

    Do the FTP script thing, it is quite painless. ...

    Do the FTP script thing, it is quite painless. The use of a file for 'locking' does have problems (research 'race conditions' if you are bored), but they are typically on the milisecond or less...
  10. Replies
    12
    Views
    2,469

    Why not post some real code?

    Why not post some real code?
  11. Replies
    38
    Views
    6,457

    fgetc() returns an INT and EOF is an INT which...

    fgetc() returns an INT and EOF is an INT which means that when truncating it to a char you will never see EOF.
  12. Replies
    8
    Views
    2,029

    Say you do your file processing at 10 AM and it...

    Say you do your file processing at 10 AM and it is expected to last 30 minutes. Then you do your upload at 10 PM and it is expected to take 5 minutes. Should never be any chance of overlap, right? ...
  13. Replies
    8
    Views
    2,029

    It is six of one, half dozen of another. If you...

    It is six of one, half dozen of another. If you want absolute control of the timing, embed it in your program. If you can be positive that the time scheduled for the file transfer will never...
  14. Replies
    38
    Views
    6,457

    So show me what is wrong, oh guru of gurus! Show...

    So show me what is wrong, oh guru of gurus! Show me how smart you are! Your FAQ tells me nothing about why my code is wrong.
  15. Replies
    38
    Views
    6,457

    I have in fact read your FAQ and I see nothing...

    I have in fact read your FAQ and I see nothing that changes my mind. Care to point out where I am so wrong, you being so smart and all?
  16. Replies
    19
    Views
    2,417

    You don't have to define the methods as inline,...

    You don't have to define the methods as inline, you just have to put the methods in the header file (it is 'bad form' to include the cpp file). The vast majority of compilers will only look in...
  17. Replies
    38
    Views
    6,457

    Care to explain to a dense 10 year professional...

    Care to explain to a dense 10 year professional programmer how my code is wrong? Your FAQ doesn't tell me how my code is flawed.
  18. Replies
    8
    Views
    2,029

    There are libraries you can link to that will...

    There are libraries you can link to that will give you FTP capability. Keep in mind that the FTP protocol exchanges username and password in the clear (as is all the data being transmitted), so be...
  19. Replies
    38
    Views
    6,457

    How about (untested): while (!feof(fin)){...

    How about (untested):



    while (!feof(fin)){
    if (fgetc(fin) == '\n') lineCount++;
    }
  20. Replies
    12
    Views
    2,469

    You must have a break in the point b loop or it...

    You must have a break in the point b loop or it will run forever, it is that simple. How to break it is entirely up to you.
  21. Replies
    12
    Views
    2,469

    If something inside your loop blocks, you will...

    If something inside your loop blocks, you will need to use signals.
  22. Replies
    4
    Views
    958

    It is a matter of style, no more. I would use an...

    It is a matter of style, no more. I would use an array with enums as indexes, but that is my style.
  23. Replies
    18
    Views
    4,557

    Well, I intended to use CHAR_BIT, but forgot. ...

    Well, I intended to use CHAR_BIT, but forgot. size_t is better syntax (i.e., more portable) and again an oversite. I agree that with the cast the mask is entirely redundant, though how you write...
  24. Replies
    18
    Views
    4,557

    How about this (tested on Solaris (bigendian) and...

    How about this (tested on Solaris (bigendian) and Intel (little endian)):



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

    void printBits(unsigned char val){
    size_t i, end...
  25. Replies
    18
    Views
    4,557

    Intel is little endian, so everything is...

    Intel is little endian, so everything is 'backwards'.
Results 1 to 25 of 212
Page 1 of 9 1 2 3 4