Posts by Strawberry Swing • 177 points
8 posts
-
1
votes1
answer31
viewsA: Problem printing code involving strings (c language)
does this right after calling the fgets: if(habitos.nome[strlen(habitos.nome)-1] == '\n') habitos.nome[strlen(habitos.nome)-1] = 0; fgets adds newline Character to the end of the string, so you need…
-
-2
votes1
answer123
viewsQ: TCP/IP protocol on Linux and Windows
The structure of the TCP/IP protocol may vary from Windows for Linux or even from language to language? the knowledge acquired about TCP/IP in the C++ language can also be taken into account in…
-
5
votes1
answer112
viewsQ: Is it prudent to use several paradigms in a C++ project?
Would it be advantageous to use several paradigms in a project in C++? For example, in a certain part of the code I use reactive Programming, in other parts I use OOP, and in other parts I use…
-
1
votes1
answer38
viewsQ: container comparison
the following code works well -> std::vector<int> vec = { 1, 2, 3, 4, 5 }; std::vector<int> mec = { 1, 2, 3, 4, 5 }; if (vec == mec) { std::cout << "true" << std::endl; }…
c++asked Strawberry Swing 177 -
3
votes1
answer1365
viewsQ: Big O notation - Complexity O(log n)
I have some questions about this complexity, which base is used in this logarithm, 2 or 10? and why? Searching Google I saw some comments saying that the base didn’t matter.. The logarithm is deeply…
-
3
votes2
answers233
viewsQ: Binary search tree (Binary search Tree) and binary search (Binary search)
From what I understand, the binary search tree algorithm works at the end of the day, in the same way as the binary search algorithm, with only a few changes, correct? More directly: the binary…
algorithmasked Strawberry Swing 177 -
2
votes1
answer51
viewsQ: Copy and move constructors are called only in the creation of an object?
The builders move and copy are only called in the creation of an object? if yes, after the creation of an object, it is not possible to call either explicitly or implicitly the move or copy…
-
0
votes1
answer91
viewsQ: Can anyone explain why this is possible? C++
#include "stdafx.h" #include <iostream> using namespace std; class S { public: S() { } S& operator=(S&) { std::cout << "copy assignment" << std::endl; return *this; } };…
c++asked Strawberry Swing 177