Posts by Rafael Bernardo • 136 points
9 posts
-
1
votes2
answers42
viewsA: Convert the first letter to high box and the accents to low box
If not for accents you could use ucfirst() or ucword(), but in this case it is better to use mb_convert_case() <?php $string = 'TÚLIO'; $new_string = mb_convert_case($string, MB_CASE_TITLE,…
phpanswered Rafael Bernardo 136 -
0
votes3
answers1130
viewsA: How to format a php array
Try Yii2’s own Vardumper user \yii\helpers\VarDumper::dump($array, 10, true); It’s a little different from the way you illustrated it, but that way it’s pretty clear…
-
0
votes1
answer1360
viewsQ: Call any function of another class of the same type
I need to pass as a parameter to a member function another member function (but of another class). I can do this for same class functions, but from another #include <iostream> using namespace…
-
1
votes1
answer55
viewsQ: Function per parameter does not modify variables
I built a binary tree class in which I have a function bfs that goes all the way through it. As a parameter this method receives a function pointer void (*Op) (node_BT <type> *) that will be…
-
2
votes1
answer91
viewsQ: Linked List - append and push
I’m trying to learn Linked List and I made the following code: #include <iostream> using namespace std; typedef struct snode { int data; snode *next; } node; void start(node ** head) {…
-
1
votes0
answers94
viewsQ: Problem of line breaking
My code is giving error in Presentation error Uri, which is about line breaking a = 0 p = [2,3,4,1] s = str(input()).split(" ") for k in range(4): a = a + float(s[k])*p[k] a = a/(2+3+4+1)…
pythonasked Rafael Bernardo 136 -
1
votes0
answers70
viewsQ: Combination of several items
I have a set of items and each item has the following elements: E = (índice, espessura, largura, demanda) i = índice; e = espessura; l = largura; d = demanda; I have two more variables: int min,…
-
1
votes1
answer388
viewsQ: Use of Thread in c++
I created a code to check the prime numbers, but I’m trying to use the core of my processor to calculate them. #include <iostream> #include <Windows.h> #include <vector> #include…
-
4
votes1
answer3755
viewsQ: Function pointer in a C++ class
I’m having trouble putting a pointer to a function in a class: int Menu::validaescolha(){ cout << 1232; return 1; } int Menu::inicial(){ int (Menu::*funcs)() = &Menu::validaescolha;…
c++asked Rafael Bernardo 136