Posts by Felipe Nascimento • 417 points
26 posts
-
0
votes2
answers110
viewsQ: Jquery - Identify automatic text
I am using Jquery to identify when the text box is text in the text box, thus: CSS: .inputtext { border: 1px solid lightgrey; margin: 0; margin-top: 11pt; width: 100%; } .inputtext:focus { border:…
-
0
votes1
answer175
viewsQ: CSS: Slider
I’m starting out in Web programming, and I’m customizing the Myanimelist list. I only have access to CSS, and I wanted to edit some effects. I have the following screen: To make the top left-hand…
cssasked Felipe Nascimento 417 -
0
votes0
answers66
viewsQ: Convert a variable to a reflect. Type
I started learning Go recently. I want to be able to save one type of data into one variable, and convert another variable to it. I know that one way to save a data type is by using reflect.Type. i…
-
0
votes1
answer284
viewsQ: Import Python DLL into C++
How do I compile a Python class in DLL in order to import it into C++, using Python features that are not available in C++? I want to be able to import it without having Python installed on the…
-
0
votes2
answers86
viewsQ: Change type of return
How do I change the return type of a mother class function in the daughter class? For example: class Mother { public: void Get() {} }; template <typename Type> class Child : public Mother {…
-
0
votes0
answers43
viewsQ: Improve interaction between files
I am creating a programming language in C++, and I intend to make some system to work with multiple files. In the simple build process, the interpreter creates files .cpp and .h and then compiles…
-
2
votes1
answer83
viewsQ: C++: Compile using Batch
I’m using cmd to program, and I want to make a batch file that automates the build process. I want him to Compile the files using the command g++ -c ./scr/Nome.cpp -o ./obj/Nome.o -std=c++1z This…
-
2
votes1
answer92
viewsQ: Algorithm for AST
I’m creating a programming language in C++. I’ve made a simple lexer, which works perfectly for now. out 5 + 7 * 3 My lexer turns it into: kw: out num: 5 op: + num: 7 op: * num: 3 nl Now I need to…
-
1
votes1
answer161
viewsQ: C++: Vector division<unsigned char>
I’m making a dynamic numeric class, storing the value of the number in a vector of bytes. I did the functions of summation, subtraction and multiplication in the same way that we learn in school,…
c++asked Felipe Nascimento 417 -
3
votes1
answer873
viewsQ: C++: what SIGSEGV means
I’m making a dynamic numeric class, but when I test it, I get the message "Program recived Signal SIGSEGV". I know this is an error with pointers, but why does it occur and how I fix it? typedef…
c++asked Felipe Nascimento 417 -
0
votes1
answer278
viewsQ: C++ Heterogeneous list
I’ve been searching the internet for weeks about lists (vector, array, list) heterogeneous in c++, however, in all websites and forums, the answer is the same: boost::any, but I wanted a way to do…
-
1
votes1
answer139
viewsQ: Execute commands in a C++ string
I have commands in a string something like: string comm = "int x; cout << \"Digite um número\"; cin << x;"; My idea is to execute the commands that are in this string, having the result…
-
8
votes1
answer1237
viewsQ: Does the type annotation in a function not guarantee the type in Python 3?
It is known that in Python it is not necessary to define the type when declaring a variable and this is interesting, however, when creating a function, I cannot restrict the types of attributes, so…
-
2
votes1
answer40
viewsA: C++: Error with Function Template
The problem is that when you call a function that uses the template, it is replicated with the past characteristics. For example, in this function: template<typename T> bool theres(T a,…
-
1
votes1
answer40
viewsQ: C++: Error with Function Template
I created a function using feedback as demonstrated in that reply, in this way: utilits. h ... template<typename T> bool theres(T a, vector<T> b); ... cpp utilities. ...…
-
0
votes1
answer1214
viewsQ: Why use getters and setters in classes?
Because I need to encapsulate the entire class, if, as a programmer, I know perfectly how to use that variable. I only see need for setters and getters that work the variable value, so: void…
-
3
votes1
answer131
viewsQ: Variable type of return
I want to do functions with variant input type, like this: int count(vector<auto> base, auto val) { int sum= 0; for (auto it : base) { if (it == val) { sum++; } } return sum; } or this: string…
-
0
votes0
answers28
viewsQ: C++ Reduction of space spent
I’m creating a c++ project with Allegro 5 using code::Blocks, and I put the Allegro files right into the project folder to make it simpler. I’m only using functions to display images and text with…
-
0
votes1
answer123
viewsA: Allegro 5 C/C++: Color problem
The answer is very simple: update the Allegro and the Mingw.…
-
0
votes1
answer123
viewsQ: Allegro 5 C/C++: Color problem
I am using Allegro 5, and read that to create colors just use al_map_rgb or al_color_html, then I made a map to easily access various colors: #include "allegro5\allegro.h" #include…
-
2
votes1
answer865
viewsQ: Python to C++ conversion
I work on my course with C++, and wanted to use a Python class variable access feature. See an example: class Telefone: nums = {} def __init__(self, numero): self.num = numero Telefone.nums[numero]…
-
2
votes2
answers96
viewsQ: C++: File header not recognizing class
I am working with several classes, and to organize myself better, I put each class in a different file. actor. h #ifndef ACTOR_H #define ACTOR_H #include "SDL.h" #include <string> #include…
-
1
votes1
answer58
viewsQ: C++: Instances of the same class
I have in a project a class Collision, and to make detection more efficient, wanted to have access to all instances (objects) of that same class. Is there any easy way to do this? Edit 1 I did this:…
-
0
votes0
answers134
viewsQ: How to detect the collision with the SDL2 floor
I’m developing a game for learning using C++ with SDL2, and I want to check when my character touches the ground. For this I created the class "Collider", with the following function (adapted): bool…
-
0
votes2
answers5055
viewsA: Largest/Minor/Sum in C++ using for
1 - Variables are not receiving initial value. 2 - Instead of n>l, do n>h. 3 - When n is greater than the higher current value, you say h=n, not the other way around. Try to do so: #include…
-
1
votes1
answer104
viewsQ: C++: Vector in a function
I’m doing a project where I use many vector vectors. Only working with array vectors is easier, so I did the following function: // add.cpp vector <string> sAdd (string In[]) { vector…