Search:

Type: Posts; User: Xupicor

Page 1 of 7 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    108
    Views
    54,200

    You could lecture others on corporate-speak. Your...

    You could lecture others on corporate-speak. Your curriculum could be titled "On how to talk a lot, but not say much at all. The art of meaningless content padding.". I can't help but think this...
  2. Replies
    108
    Views
    54,200

    You guys just don't understand that akin to the...

    You guys just don't understand that akin to the greatest warrior, the greatest programmer is one that solves a problem without ever needing to write a single line of actual code.

    The real mastery...
  3. Replies
    5
    Views
    2,882

    Well, yes, you're right, technically it's a tad...

    Well, yes, you're right, technically it's a tad more complicated than we usually tend to think about it. You're right, prototype != declaration and it matters in this case.

    Also, interesting......
  4. Replies
    5
    Views
    2,882

    void foo() { puts("OK!"); } Since () means...

    void foo() {
    puts("OK!");
    }
    Since () means any number of arguments can be passed to foo - you can call foo in a number of ways, like so:

    foo();
    foo(42, 84);
    foo("hello!");
    foo(3.14);...
  5. Replies
    17
    Views
    19,246

    Yes, it's undefined behavior, I know. My point...

    Yes, it's undefined behavior, I know. My point was not to show what will happen with destructors, but what might happen.

    On my system for example delete on new[]ed array will fire just one...
  6. Replies
    17
    Views
    19,246

    I'm no guru, but there you go: #include...

    I'm no guru, but there you go:

    #include <iostream>
    #include <memory>
    #include <cstdlib>

    class Data {
    static int next_id;
    int id;
    public:
  7. Replies
    3
    Views
    1,187

    Or you can compile them in one go if you're just...

    Or you can compile them in one go if you're just typing it in the terminal: g++ a.c b.c -o=result.exe
    Also, don't forget to use include guards in your header files.

    You can use custom function...
  8. Replies
    21
    Views
    6,546

    What's with the endl fetish? Why not just...

    What's with the endl fetish? Why not just "stuff\n"? : )


    hours_worked * hourly = total_hours;
    regular_hours * hourly = total_hours;
    (hours_worked - regular hours) * 1.5 * hourly = total_hours;...
  9. Replies
    7
    Views
    984

    As for fread(inbuf, ~0u, 1, stdin); - explain...

    As for fread(inbuf, ~0u, 1, stdin); - explain what you meant by this, exactly?

    As for the second problem - I don't get your behavior on GCC 6.1.0 on Windows at all. Please verify that your array...
  10. Is clang supported in Visual Studio already? If...

    Is clang supported in Visual Studio already? If so - that would also be a good idea.
  11. Replies
    3
    Views
    4,596

    struct B;That's a declaration of B. It's also...

    struct B;That's a declaration of B. It's also known as "forward declaration". At this point type B is incomplete, but you can use it to declare pointers to B or references to B (it's a tad more...
  12. You promised the compiler that the function will...

    You promised the compiler that the function will return an unsigned int value, but in case the second branch is executed you let the execution to reach end of a function body without returning a...
  13. Do you *need* to use recursive approach here?...

    Do you *need* to use recursive approach here? It's a really forced, bad example of recursion. (thus I assume it's an assignment)

    About the code - take the howMany function definition out of main...
  14. Replies
    9
    Views
    1,991

    Yes, when you pass the address by copy you can...

    Yes, when you pass the address by copy you can use that address to access a value under it regardless of it (the address) being a copy.
    Now, to take the sample test case I posted before - how do you...
  15. Replies
    9
    Views
    1,991

    All this boils down to the following example:...

    All this boils down to the following example:
    #include <stdio.h>

    void foo(int i) {
    i = 42;
    }

    int main() {
    int data = 0;
    foo(data);
  16. Replies
    5
    Views
    1,723

    Can you explain what parameters your eCript...

    Can you explain what parameters your eCript function takes?
  17. Replies
    16
    Views
    17,229

    #1 - naming the parameter "result" is kind of...

    #1 - naming the parameter "result" is kind of confusing. :P But to the meat of things - the copy might be optimized out, or it might not, it'd be even better if you passed the string by const...
  18. Replies
    3
    Views
    3,353

    algorism beat me to it. Yep, you just provide it...

    algorism beat me to it. Yep, you just provide it an address of a proper pointer if you want the function to change it. Otherwise you just pass in NULL there and the function knows it's not a proper...
  19. Replies
    16
    Views
    17,229

    I don't have Code::Blocks at hand at the moment,...

    I don't have Code::Blocks at hand at the moment, but... Probably yes.Assuming it's the right place - yes. There should be some place to show you what options you have applied at the moment. (Then...
  20. Replies
    16
    Views
    17,229

    Also, what compiler are you using (remembering...

    Also, what compiler are you using (remembering compiler != IDE)? (Sorry if you already mentioned it in another topic)
    If it's GCC/MinGW (some older version is bundled with Code::Blocks, even older...
  21. Replies
    14
    Views
    3,473

    Look at the order of things: - write to a file...

    Look at the order of things:
    - write to a file
    - open file
    - close file

    Something's wonky here, don't you agree? Do you walk through doors first, and only open them later? (In case you actually...
  22. It looks like you're missing dereference operator...

    It looks like you're missing dereference operator in your two last lines.
  23. Like I said in that other topic - personally, I'd...

    Like I said in that other topic - personally, I'd choose a book that covers at least C99, if not also C11. "C Primer Plus" latest edition by Prata covers C99 and C11. "C Programming A Modern...
  24. Replies
    5
    Views
    2,083

    If you have split the input cstring on space to...

    If you have split the input cstring on space to get three "tokens" then that's half the battle.

    Now look at your tokens. Three cstrings. How would you use a loop to get first letters in the first...
  25. Replies
    108
    Views
    54,200

    Dalai Lama supposedly said: “Be kind whenever...

    Dalai Lama supposedly said: “Be kind whenever possible. It is always possible.”
    By the Elders of the Internet, I tried. I feel like I actively violate the above, but to avoid doing so even more - I...
Results 1 to 25 of 175
Page 1 of 7 1 2 3 4