Search:

Type: Posts; User: whiteflags

Page 1 of 20 1 2 3 4

Search: Search took 0.05 seconds; generated 10 minute(s) ago.

  1. Replies
    9
    Views
    198

    As a technical note, if you shift left normally...

    As a technical note, if you shift left normally the leftmost bits will be discarded. If you somehow shift these bits back into the lower end, that describes a rotation.

    The method you have seen...
  2. Replies
    4
    Views
    253

    I think you're on the verge of turning your...

    I think you're on the verge of turning your tokenizer into a parser. It does not need to be more complicated than separating tokens from white space. Separating tokens like "j=+3" or "j+3" into parts...
  3. Replies
    3
    Views
    142

    While this works, the p1 object has global scope,...

    While this works, the p1 object has global scope, which is probably overkill. You wouldn't need personPtr at all.

    If the point of the exercise was to use pointers, it makes more sense to write...
  4. It is not enough to just print the numbers that...

    It is not enough to just print the numbers that are the largest and smallest. The computer is not going to remember which variable it is, so you need to also assign the largest number to a, and the...
  5. Replies
    13
    Views
    807

    I'm pretty sure you wrote hatvany() wrong. alap...

    I'm pretty sure you wrote hatvany() wrong. alap *= alap; doesn't really help much.

    You want to do, for example:
    res = 1;
    alap = 2;
    exp = 3;
    res *= alap;
    --exp;
    res *= alap;
    --exp;
  6. Replies
    12
    Views
    928

    Well, these questions are for mind readers. What...

    Well, these questions are for mind readers. What did you press? What was the four digit number you cast into?

    Here's another fact about unbuffered input. Every single keypress matters. In a way,...
  7. Well, encryption is a rather big topic and using...

    Well, encryption is a rather big topic and using it in a secure way can be hard. I'm going to assume that whatever you want to hide is fairly nonserious and you just want to protect a file from...
  8. Consider encryption. It might be a pain...

    Consider encryption.

    It might be a pain because you have to learn an encryption algorithm, and your program has to decrypt the file (in RAM) before using the contents, but the contents are at...
  9. Replies
    8
    Views
    661

    You might want to read your IDE documentation in...

    You might want to read your IDE documentation in case your setup uses a default makefile and target.

    The way that make works is "make -f <makefile> <target>" when specifying a file and target, or...
  10. Replies
    35
    Views
    2,237

    Bear with me but I don't think these cases are...

    Bear with me but I don't think these cases are very realistic. 4/5 are about cheating in gaming, which I think you know is wrong and you can be caught all the time and lose the ability to play. Steam...
  11. Replies
    6
    Views
    1,284

    OK well, by choosing to declare the array outside...

    OK well, by choosing to declare the array outside of main or any other function you are implicitly saying it has a static storage duration. This can mean a few things, but in this case it means that...
  12. Replies
    35
    Views
    2,237

    It might be instructive to read the wikipedia...

    It might be instructive to read the wikipedia page on decompilers. There are numerous challenges to doing it with any sort of positive outcome. The code that will be spit out is not a thoughtfully...
  13. Replies
    8
    Views
    628

    I think part of the problem is you repeated the...

    I think part of the problem is you repeated the material type a lot. There are two switches handling the same thing.

    It would be way easier to understand if there were one switch handling that...
  14. Replies
    8
    Views
    628

    The program doesn't even have to be that fancy,...

    The program doesn't even have to be that fancy, you can use simple techniques and get it done, just start and ask a more concrete question.

    You've done your exams, and even if you passed them with...
  15. Thread: Homework

    by whiteflags
    Replies
    14
    Views
    765

    Correct me if I'm wrong, but it looks like you...

    Correct me if I'm wrong, but it looks like you are compiling for the macintosh. You can fix the error with sleep(1); by including the Mac header for it: #include <unistd.h>. More here.

    Review how...
  16. I've also never heard of this. However, the math...

    I've also never heard of this. However, the math is based on using a scale factor. If you can figure out a suitable base-ten scale factor for your input, then you can do the math in integers with all...
  17. That wouldn't be what I would do, personally. I...

    That wouldn't be what I would do, personally. I would pass i and j into the function and calculate i*x+j internally. This way, you can think of board the way you are using it, even though it is just...
  18. I think you should be able to copy the 2D array...

    I think you should be able to copy the 2D array algorithm whole cloth if you just convert the i, j coordinates to a one dimensional subscript.

    It's a simple formula i * x + j where x is the total...
  19. My bad. Your analysis is correct, however. I...

    My bad. Your analysis is correct, however.


    I got the idea from laserlight, who posted a loop going in reverse.

    Laserlight's loop uses subscripts and goes in reverse, my loop uses iterators...
  20. Iterators aren't numbers, they don't need to be...

    Iterators aren't numbers, they don't need to be unsigned.

    For example if I wanted this to use iterators, I might write:

    for (auto it = terms.rbegin(); *it != terms.rend(); ++it)
    The type for...
  21. No, declaring variables at the bottom of the...

    No, declaring variables at the bottom of the script is not useful and is confusing at best.

    There are a couple of things going on here. First, C++ is executed in roughly top down order, so you...
  22. I think what's important here is that there is no...

    I think what's important here is that there is no way the commented memcpy() will do something that assignment won't.

    If the type can't be assigned, that will be a problem, but it's one that I...
  23. Replies
    2
    Views
    517

    The middle table always starts at 55, even if you...

    The middle table always starts at 55, even if you change the parameters of print_abc_reverse(). When you look at the loop for that table, one sees why that is:


    for(rev=55;rev<=to; rev++)...
  24. The only reason a union was suggested was because...

    The only reason a union was suggested was because you specifically said earlier, "I want to be able to store it anywhere on the stack instead of using malloc or dynamic allocation on the heap (don't...
  25. Replies
    2
    Views
    674

    Make him an offer based on what you can afford...

    Make him an offer based on what you can afford and see if he agrees. Software pricing is so divorced from simply paying for development time and other costs. Most things you buy are either priced low...
Results 1 to 25 of 498
Page 1 of 20 1 2 3 4