Search:

Type: Posts; User: Hardboy

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,410

    And what if it is standard output? How do I...

    And what if it is standard output? How do I specify "cout" to be binary?
  2. Replies
    3
    Views
    1,410

    Specifying binary output?

    Hi,

    Iīve made a program which should output som binary data. The problem is that more bytes than I specify gets out, and somehow the data seems a little corrupt. Itīs only a problem under Windows,...
  3. Replies
    2
    Views
    1,572

    Havenīt quite read your code, but, you donīt...

    Havenīt quite read your code, but, you donīt mention what is your problem. Compiler errors? Malfunctions? What?
  4. Replies
    2
    Views
    1,802

    How to get file size in C++?

    Iīd like to read in some bytes from a file, but first I need to know the file size. How does one do that in C++?
  5. Replies
    7
    Views
    1,958

    Just found the serious bug. Í used logical...

    Just found the serious bug.

    Í used logical AND instead of bitwise AND. Resulted in every byte converted to 1...
  6. Replies
    7
    Views
    1,958

    Thanks, that solved one bug. The program,...

    Thanks, that solved one bug.

    The program, though, still doesnīt work correctly. Anymore suggestions?
  7. Replies
    7
    Views
    1,958

    float/double to integer?

    Hi,

    Iīm trying to write a program that does some color conversion, but I cannot get it to work right. It seem that that the compiler doesnīt like conversion between int and double. Hereīs the...
  8. Replies
    12
    Views
    2,146

    Guess you shouldnīt be making statements in class...

    Guess you shouldnīt be making statements in class declaration:



    pointer=&h;


    Do this in your constructor instead!
  9. Replies
    10
    Views
    2,424

    Thanks! That solved all my problems.

    Thanks! That solved all my problems.
  10. Replies
    8
    Views
    2,034

    No, my friend, using & passes it as reference....

    No, my friend, using & passes it as reference.
    Using * passes it as pointer.

    Try out this piece of code yourself:



    #include <iostream>
    using namespace std;
  11. Replies
    8
    Views
    2,034

    When called, it passes the values, when returning...

    When called, it passes the values, when returning it passes the values!

    Itīs like this:



    function(type passedbyvalue,type& passedbyreference);


    The passedbyreference variable shouldnīt...
  12. Replies
    10
    Views
    2,424

    That helped! But - yeah - Iīm getting a byte too...

    That helped! But - yeah - Iīm getting a byte too much... Do you know why, cause I canīt understand this one as well....
  13. Replies
    8
    Views
    2,034

    Itīs difficult to say. I canīt see anything wrong...

    Itīs difficult to say. I canīt see anything wrong in your code, but nethier can I see anything usefull...
  14. Replies
    10
    Views
    2,424

    Should that be like: ...

    Should that be like:



    in.open(argv[1],ifstream::in|ios::binary);


    Or how should I specify it?

    Another things is - itīs not just a few bytes short, but it depends much on the file...
  15. Replies
    10
    Views
    2,424

    Sure! Itīs a program which calculates the entropy...

    Sure! Itīs a program which calculates the entropy of a source. The entropy is a statistic measure, and the calculations are working like they should. The problem is, that when run on window -...
  16. Replies
    5
    Views
    1,454

    Use your defines! You have defined TABLE_SIZE...

    Use your defines!

    You have defined TABLE_SIZE but you donīt use it. Do yourself the favor!
    Also define like:


    #define MAXLINESIZE 256


    and replace your magic 256-number with that.
  17. Replies
    10
    Views
    2,424

    >>>while(in.good()){ >>>data[i++]=in.get(); }...

    >>>while(in.good()){
    >>>data[i++]=in.get(); }
    >This is a buffer overflow just waiting to happen.

    I know that, but right now itīs only in test phase, Iīll adjust that later.
    ...
  18. Replies
    10
    Views
    2,424

    Input problems with DJGPP?

    Hi,

    Iīve written this program to input some data, and make some calculation on this data. Problem is that I cannot get the input working. Iīve copied the code from another program of mine where...
  19. Replies
    3
    Views
    13,034

    Using NaN in c++

    Is it possible to assign a double to NaN in c++ like:



    double number = NaN;


    Suggestions welcome...
  20. Replies
    1
    Views
    1,224

    You seem to know pretty much what you wanna do....

    You seem to know pretty much what you wanna do. Hereīs my advice:

    1. Write pseudo
    2. Convert to C++
    3. Compile and Run
    4. Find errors, and if you canīt, then come back here and ask!

    Specific...
  21. Replies
    1
    Views
    943

    Checking overflow?

    Does anyone know how to check for overflow in a c program?

    like when:



    result=var1+var2;


    How do I know if an overflow has occured?
  22. Replies
    7
    Views
    2,234

    Sure I could read the thing into a string, but...

    Sure I could read the thing into a string, but what I search is a function that will FLUSH unread input. I thought clear(): did that, but it doesnīt... Any suggestions?
  23. Replies
    7
    Views
    2,234

    How to Flush standard input?

    Hi!

    Iīm trying to fulsh standard input - all though this seems not possible to me. My code is:



    bool exit_status;
    char current;

    exit_status=false;
  24. Replies
    4
    Views
    1,269

    Some compiler support differenīt syntax for main....

    Some compiler support differenīt syntax for main. Check your compiler documentation - maybe youīll find one which suits you better...
  25. Replies
    2
    Views
    5,611

    Just got it working! I needed to write like...

    Just got it working!

    I needed to write like this:


    private:
    istream& is;


    Intead of:
Results 1 to 25 of 29
Page 1 of 2 1 2