c++

Working with strings, characters. Returns an error (c++)

I enter my last name, first name, and patronymic as a single string of characters. I found out the length of the string, as w ... { Q1.erase(Q1.find('A'), 1); Q1.erase(Q1.find('O'), 1); } cout << Q1; return 0; }

What's faster: Dynamic memory allocation vs array, Windows 7 vs Linux

A test is written to measure the speed between dynamic memory allocation and array usage, as well as between Windows 7 64-bit ... gh new and delete are used? Why is Linux faster than Windows 7? PS. Both use the release version with speed optimization.

What is Integral arg c++ 11?

fabs(Integral arg) What is Integral arg, and where can it be used? ZY. If it is not difficult, then with an example, please.

What are iterators and why are they needed?

I can't understand the main purpose of iterators . Googling, all the same did not understand. Please explain: What is an ... ages on the pointer How to describe it programmatically in the code? (that is, make your iterator similar to a library one).

Modules in C++ - what is it and when to use it?

What are modules? Why are they needed and how do they differ from header files? When should I use one, and when should I use the other?

Why do I need to write typename to specify the type?

When using templates, sometimes you need to write typename for types - when and why do this? template <class T> inline ... l.begin(); pos!=coll.end(); ++pos) { std::cout << *pos << ' '; } std::cout << std::endl; }

Clearing the screen

Tell me, please, is there a function for cleaning the screen in C++? Do not offer to use the conio library: because it is not ... declared in this scope That is, I would like to see a library and a cleanup operator or a library for systems ("") for C++.

String concatenation in C++

Help with this task: we get two strings(character arrays), and pass them to the function for concatenation(I did this only so ... = (len == 0 ? strlen(str2) : len); strncpy(res, str1, strlen(str1)); strncpy(res + strlen(str1), str2, copy_len); }

Implementing a C++ project in Android Studio

Worked with OpenCV in C++, now it's time to do it on android. How to properly connect an old C++ project to JNI?

How to multiply two binary numbers modulo 2 that are stored as strings

Example: In the zero position, the highest digit of the binary number is stored. The result is a number consisting of digits ... return t; } But it turns out that it counts incorrectly, that is, the answer does not match what is in the picture.

Why can't I stack pointers?

The exam asked a question: Why can't I stack pointers? The difference between pointers returns the number of elements betwe ... should return a certain number, but it turned out that the addition of pointers is not defined. I'm interested in the reason.

Where to get stdafx.h in Visual Studio 2019?

Installed Visual Studio, download everything you need, started working and saw that "stdafx" is missing. Where can I find it in the public domain for download and where to throw it off later?

Connecting the. obj file VS 2017

When trying to connect .obj file error occurs LNK1107 invalid or corrupted file: cannot be read by 0xDF HLL D:\Aleksey\Learni ... ------------------------ xor eax, eax xor ebx, ebx mov ebx, mat_a ; pop ebp ret add_matrix endp end

How does c str() work in c++?

I am interested in what the array looks like, which is a pointer to. I understand that the function takes a string such as s ... "12345"} ? And another point , if it returns a pointer, then why does this work: cout << str.c_str() <<endl;

Debag C++ code in VS Code

When you try to run the C++ code for the debug (F5, the breakpoint is set) in Visual Studio Code (Ubuntu 18.04 OS), an error ... without breakpoints and with a breakpoint on line 7 (return 0;). What might be causing the problem, and how can I fix it?

Take out a template class method в.срр

How do I move a template class method from a header to a cpp ?

Pre-declaration of the class in header files

Player.h #ifndef PLAYER_H #define PLAYER_H class ResourcePack { protected: // something }; class Player : ResourcePack { pu ... w can I pre-declare the Player class in the Render.h file (since it inherits from the ResourcePack class, nothing comes out)?

Evaluate the hash table implementation

In the county town N, a competitive selection was held and the task was given: "implement a hash table". The task seems to be ... ewTable.find("Ilaj"); if ( search ) { cout << search->surname << endl; } return 0; }

Error - undeclared ID

When programming on C++ in Visual Studio, an error appears in the operators сout and cin. The compiler writes that these oper ... ; cin >>T; alpha = asin(g*T/2*V); cout<<"Значение угла альфа равно = "<<alpha; return 0; }

Why does C++ allow you to call the destructor of a constant object manually?

Please tell me, what is the reason that the language allows you to call the destructor for a constant member (manually)? Afte ... osition { public: // ... const Object object; }; // ... Composition composition; composition.object.~Object();