c++

Pointer to an array of char *tmp; cin>>tmp characters;

Please explain why this code works: cout << "Test: "; char *tmp; cin>>tmp; cout << "Test: " << tmp << std::endl;

Rewrite the C++ code in php

There is such a code in C++ How to write an analog in php? Actually, there is a problem with the assembly language commands ... $f_name1="tmp.ms"; $f_name2="tmp.mse"; $testCrypt = new MyTest(); $testCrypt->crypt($f_name1,$f_name2);

How to split a string into C++ words (Arduino)

At the input, we must give "test=qwerty" we need to divide by = For example, split ("test=qwerty","=") the output should be ... i]; if ( text[i] == del ) { arr[count] = step_text; count++; step_text = ""; } } return arr; }

The Prototype pattern.(from the Gang of Four")

The "Prototype" pattern is illustrated in the above book with the following example The motivation for using this pattern is ... nd copy the "prototype" if the client has already received a specific prototype in the constructor and can work with it work?

How do I get a random number generator to give fractional values?

I can't figure out how to get a random number generator to give fractional values. I tried to do this. A = rand() % 158.6 ... свобождение памяти for (int i = 0; i < N; i ++) delete [] A[i]; delete [] A; system("pause"); return 0; }

Knight traversal of the board

The problem, apparently, is an Olympiad, on recursion. Actually, you need to go through the entire board with a knight so tha ... } else q1 = 1; } } return q1; } In main() it is set n, board[1][1] = 1, and is called function set(2,1,1).

Initialize array variables with a single value without a loop?

1) Please tell me, is it possible in C++ to somehow initialize all the values of an array with the same value, without using ... nst int M, which will be equal to 10 to the power of N. The function pow in this case can not be used, then how can I do it?

Array library, entering the size of an array from the keyboard

Is there any way, using array (int, N) name; to enter the size of the array (N)from the keyboard?

Removing duplicates from std::vector

There are 3 coordinate vectors: x_vect, y_vect, z_vect. They contain the coordinates of the points, i.e. the coordinate of on ... sary to make sure that all the points remain in the end, but without repetitions. It is necessary to remove duplicate points.

Read access violation at address 0x00000000

#include <iostream> #include <string> struct Auto { std::string Manufacturer; std::string TitleModel; ... exception was raised at 0x0F7AF6E0 (ucrtbased.dll) in Task2.37.exe: 0xC0000005: read access violation at address 0x00000000.

Directed graph with distances

Hi everyone) How can I implement a graph oriented with vertex distances. I.e ., the input is vertex A, vertex B, and the distance between them is 6. And B C is the distance between them is 3. And A C the distance between them is 1.

An undeclared identifier that should be returned by the function. What am I doing wrong?

All health, faced with such a problem here. It was necessary to output an array, the number of elements of which depended on ... ". As far as I understand, some radically different approach is required here. If anyone has something to share, I will glad)

PNG format IDAT chunk, how to upload PNG

I need to extract color information from an image in the png format, including the alpha channel. If you open the image in th ... need will be located in the IDAT block. True, they are encrypted there. Can anyone know how to decrypt this block using C++?

c++, graphs, from adjacency matrix to incidence matrix, undirected graph

Please help me how to go from the adjacency matrix to the incidence matrix, I have already gone through everything and have n ... lt;< G[i][j] ; } cout << endl; } cout << endl; return 0; system("pause"); }

How do I choose a null value for the base types in the template?

How to choose a value for basic types int32_t, int8_t etc. for a template class? That is, that the const bool is_empty() con ... gt; inline const bool point_base<__type>::is_empty() const noexcept { // выполнить проверку что значение нулевое }

A pair of vectors or a vector of pairs

Which will be more productive in the general case: a vector of pairs or 2 vectors, where each contains its own element? The ... r operations: getting one of the values of the pair by the index, adding the pair to the end, removing the pair from the end.

What is the meaning of std::forward when passing parameters?

What is the difference between the following two ways of passing parameters? template <typename ...Args> smth(Args &am ... (args...) {} template <typename ...Args> smth(Args &&...args) : base(std::forward<Args>(args)...) {}

What exactly do std::move and std do::forward?

I am familiar with Move Semantics and Perfect Forwarding. But I am tormented by one question, which is the following: void fu ... nsfer" doesn't work. And without std::move, the "move semantics"doesn't work. Tested experimentally. So what's the big deal?!

Template method for c++containers

There is a method void SortVector(vector<int>& vec, int topV, bool wozrastanie) I want to make it a template to ... vec, int topV, bool wozrastanie) Is it possible to solve the problem without rewriting the same method for each container?

Is the static variable in the class method the same for all objects of the class?

Is the static variable in the class method the same for all objects of the class?