Задать вопрос
Ответы пользователя по тегу C++
  • Как протестировать функцию, в которой пользователь вводит данные?

    @Miron11
    Пишу sql 20 лет. Срок :)
    Did you try this?
    Оператор SendKeys
    The other way is to write an c/c++ program using win32 API "startprocess", grab its handle, and send to the console window keystrokes using "SendMessage" core API method, one symbol at a time.
    I wonder if this is really what you want, because it looks more like testing keyboard events of a computer than your function.
    Perhaps for a test you can substitute this "readline", with something that reads lines from some file, you pass to test program at the beginning in the form of input parameter from command line or using some kind of configuration approach.
    This will not really invalidate your API, but reduce complexity of arranging user input to something, I'd say, reasonable.
    Ответ написан
    Комментировать
  • Как будет работать система плагинов, при условии что плагины можно писать на разных языках?

    @Miron11
    Пишу sql 20 лет. Срок :)
    nothing can be easier.
    in the end all you need, is have your mind work through the following point "what it means to have plugin and what it means to the application that launches this plugin"
    to my understanding, all there is to it is electronic data interchange protocol, EDI.
    For EDI first thing you define is "what"
    Second thing you define is "how"
    And the last, the third one, is you define, depending on your application very special needs is "when".
    ---
    To tally thing up and to clarify, where you stumble at the moment, on my mind, is you are trying to explore and come to definitive conclusion with regards to point, that has no real bearing on what you need to do, what you are asking is "which".
    That is simply is a moot point.
    ---
    Now, that above points simplify and somewhat layout fundamentals, one usually picks and chooses from toolchest what to do.
    What should be the format of EDI between main application and plugin ( or subfeature )? -
    a. none
    b. CSV, Excel, Flat, TSV, LLVT, Parquet, Fixed Width ... ... ... yada yada yada - THE FILE
    c. database, well, I am fun of SQL Server, but you are more likely to prefer Postress or Oracle? ( smile )
    d. there is always a network way, which can be as simple as raising HTTPServer, however this idiom is implemented in the form of class in the language of your choice, followed by using Get, Post, Put, Delete ( my vocabulary of RESTFull verbs is limited, but it is readily available on the Yandex ), yes, one can open a socket ( whatever that means ) and then there are yet more ways, IPC, Shared Memory ( now, don't really use this last one, it never works well even within same language application, unless you really know what and how to do here )
    this point d can be further extended and deliniated.
    It can be local ( yes, the localhost, IP Address 127.0.0.1 exists!!! I have seeing it, and it's there, and I can prove it to you in 30 seconds, even if you are in Africa! And then there is network, sometimes, and when there is network there is yamm yamm yamm cloud ( this is where warm and fuzzy feelings usually start to flow ).
    And the nice thing about point d, particularly RESTFull, it works and it is easy, and it can be done practically in any language today, more or less.
    If I haven't annoyed you at this moment, it would probably mean that you are invariably damaged person when excessive beliefs in technology, go out and have a nice and long walk.
    Ответ написан
    Комментировать
  • Почему используется потенциально неинициализированная локальная переменная-указатель "matrix"?

    @Miron11
    Пишу sql 20 лет. Срок :)
    When code reaches this line:
    if (d == '1') {//ручной ввод данных в матрицу
    it sees curly brace "{" and opens, what is called, a new scope of automatic variable.
    Subsequently this line:
    //создаем массив
    float** matrix = new float* [n];
    is the place where the above feature allows for mistake to occur.
    If it wasn't for new scope, compiler would have notified you of error, something like "attempt to declare variable, variable matrix already declared"
    provided you with error message, line number, and later edition even notify users of possible fix.
    All you need to do is to remove
    float** inside this if condition
    --if (d == '1') {//ручной ввод данных в матрицу--
    and error would be mended.
    Here is link from wikipedia. I have red its section "In specific programming languages", subsection "C, C++", and I can confirm that it is speaking truth.
    Ответ написан
    Комментировать
  • Какой open source проект написан на труъ Си++?

    @Miron11
    Пишу sql 20 лет. Срок :)
    Good example with templates and patterns.
    One of a few projects where modules carefully encapsulate internals and expose a finely tuned publicly accessible interface
    https://github.com/apache/arrow.git
    Ответ написан
    Комментировать
  • Есть ли новые книги или другие ресурсы по COM?

    @Miron11
    Пишу sql 20 лет. Срок :)
    Может уточните, какой аспект COM вас интересует.
    Самые свежие напечатанные материалы которые есть на полке 2000-го года. И они разбиты по общей теории, сервер технологии, транзакционный сервер, ATL и MSMQ.
    В последний раз сам работал с компонентом был недавно ( немного удивился ). Обошелся тем что нашел сам компонент ( в Win SDK ), сгенерировал для него RCW интерфейс в Вижуал Студио
    https://msdn.microsoft.com/en-us/library/8bwh56xe(..., нашел описание .NET interface, и дальше писал в С-sharp.
    Ответ написан
    Комментировать