Posts by game doido • 57 points
10 posts
-
0
votes1
answer91
viewsA: How do I insert elements of a first vector into another second vector, at a given user position? and still print step by step
I don’t think you can create vectors with a variable, I think only with constants or you need to dynamically allocate memory to the vector. Using new or malloc. Here is an example code using vector…
-
0
votes1
answer21
viewsQ: I can’t find the Glew graphical library
The GLEW library website is off the air, http://glew.sourceforge.net/ Does anyone know a site where I can download. I even found some but don’t have the files I want, which is bin, include and lib.…
-
2
votes1
answer169
viewsQ: How do you create an optional parameter in a class method?
I know that to create an optional parameter in a function you can do this: void exemplo(int a,int b=0); But how do I do it in a class function ex: class Exemplo{ public: void nada(int,int); }; void…
-
0
votes1
answer74
viewsA: Error running Hello World project with default eclipse CDT condigo
I don’t know much about how things work in the eclipse but I’ll try to help you out. You created a project and added the PQ.cpp file, is this file in the same project directory? if yes look at the…
-
0
votes2
answers130
viewsA: Suggestions for code improvement
I realized that for one person to play another has to type the word and give the hint, so you could save several words per category in a file and pick them randomly. example in your menu would have…
-
0
votes4
answers9882
viewsA: Program to discover repeated characters in strings and print backwards
In the above case he would be taking the amount of times that this character repeats, I think that is not what French K meant, but how many elements repeat example: if we use the word…
-
0
votes1
answer526
viewsQ: Change an attribute of a base class by the derived class C++
I’m having a problem involving inheritance in C++, I can’t change an attribute of a base class ex: // classe base class Base { vector(string) Names; //coloquei entre parenteses porque por algum…
-
1
votes3
answers4086
viewsA: Warning: control Reaches end of non-void Function - c++
Why don’t you use a for instead of several ifs. It will get less confusing and smaller. int max_of_four(int a, int b, int c, int d){ int numbers[4]={a,b,c,d}; int biggest=a; for(int i=0;i<4;i++){…
-
1
votes1
answer223
viewsA: C program that reads a text file and prints the lines in reverse order
First, you better make one cast for the return of malloc(), because in some compilers may not compile, my for example. Would look like this: linha *l1 =(linha*) malloc(sizeof(linha));…
-
1
votes1
answer41
viewsQ: Program in c++ hangs when I use a function to pick up a file name
I’m making a small IDE in c++ and I’m having trouble getting a file name. ex: the full file path is "Keywords//cplusplus.txt" but the file name is "cplusplus.txt". So I wrote a function to get his…