Search:

Type: Posts; User: john.c

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    81

    It's not "decyphering" anything. It's calculating...

    It's not "decyphering" anything. It's calculating a sum and then complaining if it's not 0x31.

    With some assumptions, I think the code is better expressed like this (I've given variables somewhat...
  2. Replies
    2
    Views
    115

    It's probably best to initially read each of the...

    It's probably best to initially read each of the files into arrays. Then you can randomly print the names from the arrays.


    // rnd_names.c

    #include <stdio.h>
    #include <stdlib.h>
    #include...
  3. Replies
    7
    Views
    201

    #include #include #include...

    #include <iostream>
    #include <memory>
    #include <vector>

    struct B {
    int Val;
    B(int val = 0) : Val(val) { }
    virtual ~B() = default;
    };
  4. Maybe more like this. (Sorry, but I couldn't test...

    Maybe more like this. (Sorry, but I couldn't test it).


    void FindFile(std::wstring dir)
    {
    dir += L"\\*";

    WIN32_FIND_DATAW file;
    HANDLE search = FindFirstFileW(dir.c_str(),...
  5. Your code has an error, although it doesn't show...

    Your code has an error, although it doesn't show up in your example since you are creating a square matrix.


    // In allocateData2DbyMalloc, this
    for (unsigned int i = 0; i < nColumn; ++i)...
  6. You don't know what you're talking about....

    You don't know what you're talking about.
    There's no difference.
  7. Of course it doesn't. I vote to cancel...

    Of course it doesn't.

    I vote to cancel "Structure's" account.
  8. Replies
    5
    Views
    476

    As usual, "Structure" doesn't even bother reading...

    As usual, "Structure" doesn't even bother reading the question.


    double roundUpDecimalPlaces(double x, int decimalPlaces) {
    double mag = 1.0;
    for (int i = 0; i < decimalPlaces; ++i)
    ...
  9. Replies
    33
    Views
    1,451

    I vote to cancel this idiot's account.

    I vote to cancel this idiot's account.
  10. It presumably needs to be something like this...

    It presumably needs to be something like this (all on one line):


    link.exe
    /nologo
    /subsystem:windows
    /LIBPATH:"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\x64\"
    ...
  11. When you are not logged in, an ad is shown in...

    When you are not logged in, an ad is shown in that location.
    Since you are using an ad-blocker, it appears as a blank space.
  12. You need to link against the library that defines...

    You need to link against the library that defines that windows function. According to the documentation, the library is User32.lib. I don't use windows so I'm not sure of the command line syntax, but...
  13. #include #include inline...

    #include <iostream>
    #include <string>

    inline char get_char_at(const std::string& s, int row, int col) {
    return s[(row + col) % s.size()];
    }

    int main() {
    std::string s;
    for...
  14. total moron

    total moron
  15. Replies
    13
    Views
    949

    It's a truly stupid question.

    It's a truly stupid question.
  16. Thread: char*

    by john.c
    Replies
    16
    Views
    1,014

    Best to make no assumptions.

    Best to make no assumptions.
  17. It would be slower to do it that way then to just...

    It would be slower to do it that way then to just search the file in one piece (with one thread).
  18. Replies
    4
    Views
    293

    The answer is just the binary representation of M...

    The answer is just the binary representation of M - 1 given in N bits, where 0 is represented by A and 1 by B.


    #include <iostream>

    int main() {
    int n, m;
    std::cin >> n >> m;
    ...
  19. Maybe you should change your username to RyanD....

    Maybe you should change your username to RyanD. :cool:
  20. Replies
    5
    Views
    330

    Try to figure it out yourself? You obviously...

    Try to figure it out yourself?

    You obviously aren't very smart if you think stahta01's name is "Bill". I guess you think my name is "Carl".

    Have a nice day!!! :cool:
  21. Replies
    8
    Views
    277

    Stucture's "solution" is total garbage. :wink:

    Stucture's "solution" is total garbage. :wink:
  22. The basic answer is that you already know how...

    The basic answer is that you already know how many records there are. Three. Problem solved.

    If you wish to calculate the size, then in the case of a statically-allocated array for which you have...
  23. Thread: Data type

    by john.c
    Replies
    5
    Views
    226

    You are truly an idiot. :wink:

    You are truly an idiot. :wink:
  24. That's exactly what your loop says: "while no key...

    That's exactly what your loop says: "while no key has been pressed, keep looping" (i.e., stop as soon as a key is pressed).

    Presumably you want something more like:


    while (true) {
    ...
  25. Replies
    4
    Views
    204

    Nah. Format strings are notoriously fiddly...

    Nah. Format strings are notoriously fiddly things. :)
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4