Posts by Igor PTZ • 489 points
33 posts
-
0
votes1
answer131
viewsQ: Error accessing PHP application via Docker
I’m having trouble accessing the application via Docker. I’m getting a "Unable to connect" firefox error when trying to access the localhost:8899 address (ja tentei127.0.0.1:8899 and it also doesn’t…
-
3
votes1
answer56
viewsQ: Question about address in the pointer mémoria
I put a Cout in the way insertRight to verify the memory addresses of node1 (of the variable itself and not of what she keeps) and to my surprise the addresses shown repeated several times, as shown…
-
1
votes1
answer193
viewsQ: Why there are member initiators
In C++ we have the member initializers const. 1) Why such an appeal exists ? 2) How he acts under the cloths ?
-
2
votes1
answer73
viewsQ: Data Member Initialization Question const
"The 'constancy' of a const object is imposed from the moment the constructor completes the initialization of the object until the destructor of that object is called" - Deitel,++ If the compiler…
-
3
votes1
answer80
viewsQ: Questions about "linkage"
I tried to pass to IDE a code I found in a book and some doubts arose. Code: newApplication.cpp #include "stdafx.h" #include <iostream> using std::cout; using std::endl; #include "GradeBook.h"…
-
1
votes1
answer30
viewsQ: Problem with macro
I’m trying to solve the following exercise: Write a program that defines and uses the PRINTARRAY macro to print an integer array. The macro should receive the array and the number of elements in the…
-
0
votes1
answer357
viewsQ: Zend Framework error 3
I’m trying to open the localhost:8080/person url but always has a fatal error ( Uncaught Zend Router Exception Runtimeexception) that I can’t interpret right. My directories are like this: -config…
-
1
votes1
answer214
viewsA: Problem removing at the beginning in a doubly chained list
The problem lies there: void retira(Cliente *cabeca){ if(cabeca->prox == NULL){ printf("lista esta vazia"); }else{ Cliente *aux; aux = cabeca; cabeca = cabeca->prox; // cabeca->ant = NULL;…
-
-1
votes2
answers2007
viewsA: Concatenate Strings in C
You can do a control to capture uppercase and minuscule vowels, as well as avoid unforeseen events if a typed word does not have a vowel as follows: #include <stdio.h> #include…
-
1
votes1
answer41
viewsQ: Unzipping of characters
I’m having difficulty in the following exercise Using the right shift operator, the AND operator over bits and a mask, write a function called unzippaCaracters that receives the integer unsigned and…
-
1
votes2
answers45
viewsQ: Failure to trigger an event
I have a function called conferirPalpite() that in thesis should be triggered by the button "Send guess" (this button has an id = "uploadPalpite"). I can add the value on the screen but when…
-
4
votes2
answers175
viewsA: Doubt of if He is
The problem in your code is in the block below else if (c=101) { ns=s+(s*0.1); } else if (c=102) { ns=s+(s*0.2); } else if (c=103) { ns=s+(s*0.3); } The statements of the conditions imposed on us…
-
1
votes3
answers2944
viewsA: While use within the if
For this algorithm to have infinite loops until a condition is not met (Ex: while(media != -1)) you need to introduce a repeat structure. Behold: #include <stdio.h> #include <stdlib.h>…
-
1
votes2
answers302
viewsA: When I run the commands on Switch Case, does it end instead of going back to Menu?
To prevent the programme from closing, one of the alternatives is to use the repeating structure while with a condition referring to the option to leave while(i != 7). To prevent the prompt from…
-
5
votes1
answer72
viewsQ: Atomic Types in C language
What is the difference between primitive and atomic type ? What are atomic types for ? In which situations they are applied ?
-
0
votes3
answers665
viewsA: Register with C File
For example let’s say the file was created this way: #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> typedef struct Registro { int chave; char…
-
0
votes1
answer62
viewsA: Problems when printing the sorted number file
In calling the function OV, you pass zero in the second argument. int main(){ srand(time(0)); setlocale(LC_ALL,"Portuguese"); int t, i, n[TAM], ini=i, fim=TAM-1; opcoes(); t=clock(); CV(n);…
-
1
votes1
answer55
viewsQ: Problem on game startup
I’m trying to run a game I made in Allegro 4, the application only runs normally in the first compilation/execution. If I close Devc++ and open again or try to run the generated . exe file, the game…
-
0
votes3
answers497
viewsA: Char pointer in printf() does not work
If you want to print a vector of characters instead of a string, you can do the following:: #include <stdio.h> #include <string.h> #define TAM 3 void preencher(char *str,char letra){ int…
-
0
votes2
answers332
viewsA: Recursive program doubt for writing vowels in C
I would just like to add to Mr Stafusa’s reply. If you want to insert words with uppercase and minuscule letters just type the function as follows: void escreverVogais(char s[],int i){ if(s[i] ==…
-
1
votes1
answer1505
viewsA: Vector union, no repetitions in C
You can do it that way: #include <stdio.h> #include <stdlib.h> #define TAM 5 int verificar(int elemento,int vetor[],int tamanho); int main() { int vet1[TAM]; int vet2[TAM]; int i; for(i…
-
2
votes2
answers161
viewsQ: Pointer for C functions is not calling
I’m having a problem with function pointers. I declared the pointers and stored them in an array, but when calling the functions through the pointers the compiler has an error that I have not yet…
-
0
votes3
answers45
viewsA: Error while printing values, the values that are printed have nothing to do with the values that were saved
The functions getLargPC and getAltPC return an integer, but this does not mean that the integer will be printed automatically You will need to do this to print the result returned by these…
-
0
votes1
answer129
views -
0
votes3
answers1105
viewsA: Reading Struct Strings with Wrong Scanf
Good evening Yuri, I tested your code and apparently managed to solve the problem as follows: printf("\n--- PRENCHA OS DADOS DE CADASTRO DO CLIENTE ---\n\n"); printf("Digite o ID do cliente: ");…
-
1
votes1
answer463
viewsA: How to remove all nodes from a circular list?
I built this method in C++, but it’s easy for you to pass it to C. void clean() { if (head == NULL) { cout << "A lista esta vazia\n"; return; } else { while (head != tail) { Node * aux = head;…
-
0
votes2
answers889
viewsA: How to remove a structure element
A block of your code looks like this: Imprima(prim); printf("Escolha um numero que queira remover: "); scanf("%d", &num); prim = retira(prim, num); Imprima(p); system("pause"); The problem is in…
-
0
votes1
answer158
viewsQ: Problem in memory displacement
Good evening everyone, I have been facing a problem regarding free() function in the Dysstroy() method, for memory offset. After inserting values in the binary tree at first I can even displace…
-
0
votes1
answer104
viewsQ: Problem in Binary Tree implementation
Good evening, folks. I am trying to implement a binary tree with methods to insert(Insert,insertLeft and insertRight) and print (print). All goes well until I try to insert a knot in the tree…
-
0
votes2
answers143
viewsA: How to program according to good OO design practices?
Maybe it’s not exactly what you’re looking for, but a good practice is to use the set method to control the consistency of the data and prevent negative values from being saved where they shouldn’t.…
-
1
votes2
answers315
viewsA: Error in code - Arrayindexoutofboundsexception
The vector B is a matrix 2x1 and the vector To is a matrix 2x2 In that part of the code: for(int i = 0; i < A.length;i ++){ for(int j = 0; j < A[0].length;j ++){ System.out.print(A[i][j] +…
-
-2
votes2
answers90
viewsA: Error trying to scan an array
The error refers to the burst of the vector’s Dice. The right thing would be: for(int c = 0; c < 10; c++) { System.out.println(nota[c]); }
-
0
votes1
answer303
viewsQ: Simply chained list - Method problem
I’m having a problem with the method delete_find_number of my code. It is as follows: this method must exclude a specific number which is passed as a parameter. After receiving the parameter, this…