c++

Остаток для негативного аргумента ошибочен?

Во многих языках программирования (C, C++, C#, Java, различные диалекты Паскаля, PHP, Javascript) есть оп ... 0 = 0 * 3 + 0 -1 / 3 == -1 -1 % 3 == 2 -1 = -1 * 3 + 2 -2 / 3 == -1 -2 % 3 == 1 -2 = -1 * 3 + 1 И т. д.

Getting the modulus of a number without a comparison operation

We take a simple code: void main() { int x = abs(-1); } Assembling and disassembling it: $ gcc sample.c -o sample && ... 0 sub %edx,%eax How can I get the absolute value of an integer in C/C++ without a comparison operation?

How do I explain what a bytecode is? [closed]

Closed. It is impossible to give an objective answer to this question . Answers to it are not accepted at the moment. ... it seems that something came to them, but how can you explain the principle of bytecode using life examples on your fingers?

java.lang.UnsatisfiedLinkError: Can't find dependent libraries - iostream

Continuing to investigate JNI came across this point: in the files in which I describe the implementation of methods (cpp), w ... intf test"); // std::cout<<"test cout\n";// даже если это закомментировано а iostream подключен - всеравно ошибка }

And is there encapsulation if there is reflection?

In principle, the whole question is in the title. It turns out that one of the main tasks of encapsulation is not at all, namely, hiding the methods or fields of the object from unwanted use by intruders.

Notification daemon (background program) in Java

Recently, I began to study the topic of VK bots, Telegram and other social networks. They have one problem: to see a notifica ... find an implementation in Java, but if it is easier to implement this task in C++ for some reason, please explain, thank you.

Static field in generics/template

There is a Java generics class of the type: public class MyClass<T> { static long myField=System.currentTimeMillis( ... : Are var1.myField and var2.myField the same? Update And if it is a template in C++/C# - then will they be the same or not?

Android jni javah

I'm trying to create an h-file for android via javah. The com.example.test class.MainActivity. How to use javah correctly? Sh ... ses or src? Somewhere I read that the wrong javah can be used, depending on the paths in the patch(xs which is not the one).

Java or C++ for a database

I was given a course work on the subject of databases, and I have a question: with the help of which language to implement th ... estion: what is more relevant today and which language is more suitable for the purpose of writing a database of Java or C++?

C++ interfaces like the Java interface

I studied Java, now I wanted to learn a little more C++. I wanted to invent a bicycle like sorting. I wanted to do something ... ill try to clarify my question again: I need to make a function parameter-an instance of a class inherited from the interface

Introduction to java Olympiad Programming

I translate my meager knowledge from c++ to java. Share the main methods? For example, in c++, the input is cin, you need t ... n java and what else can be useful? Here is an example of the task (http://codeforces.com/problemset/problem/550/A?locale=ru)

How do I create a template that inherits from a class (JAVA, CPP)?

I want to understand if there is a possibility in cpp to make a generic type inherit some class(since there are no interfaces ... is, I know for sure that the object that will be served to me as a type will have the method I need How do I do this in cpp?

Java, C / C++, C# developer-hardware requirements [closed]

Closed. It is impossible to give an objective answer to this question . Answers to it are not accepted at the moment. ... . How many times I tried to code on a laptop-I don't pull a fig, just like on office typewriters. Who has what - we share it!

Crash when running the java.lang.UnsatisfiedLinkError application

There is an application that uses the native library. When running on android 5.0 (Asus ), everything works fine, but if you ... ove the code that uses atof, I get A/libc: Fatal signal 11 (SIGSEGV) at 0x00000020 (code=1), thread 12787 (ostorm.rakdroid)

Problem with porting code from c++ to java

Good afternoon. I'm porting code from c++ to java (android). I ran into a problem when transferring the function of the Eucli ... g, long Why is this operation impossible for the long type, and how can I improve the situation? P.S. I'm still new to java.

C++ to Java - the equivalent of the swap function

What is the analog of the function swap in C++ std::vector Namely: vector1.swap( vector2 ); In Java, as vector I use ArrayList.

C++ or Javascript? [closed]

Closed. It is impossible to give an objective answer to this question . Answers to it are not accepted at the moment. ... ything, and C++ requires a compiler. If it is not difficult, advise along with arguments and links. I would be very grateful.

Connecting Java c C++ to qt via QAndroidJniObject

Tell me how to connect Java c C++ to qt via QAndroidJniObject? This is my .pro #--------------------------------------------- ... directory I did it according to the documentation : https://doc.qt.io/qt-5/qandroidjniobject.html Please tell me what to do?