Posts by pp fernandes • 97 points
6 posts
-
0
votes1
answer26
viewsA: How do I transfer data from the inherited array(Objects) to the array(reserves)?
To solve the problems I simply created two new methods one in the superclass to fetch an Object and the other to match that Object to this.reserva[i]. Method created in the superclass to fetch an…
-
0
votes1
answer26
viewsQ: How do I transfer data from the inherited array(Objects) to the array(reserves)?
package pkg2017ppfp09; import ObjectManagement.ContainerOfObjects; /** * * @author pf */ public class GestorDeReservas extends ContainerOfObjects{ private final int MAX_RESERVAS = 10; private final…
-
6
votes1
answer1950
viewsQ: How do I save a string of indefinite size to a structure?
#include <stdio.h> #include <stdlib.h> #include <string.h> struct Ecoponto{ int codigo; int contentores[3]; char cidade[20]; char *rua; int nporta; }; int main(int argc, char**…
-
2
votes2
answers167
viewsQ: How do I pass an array of structure pointers to a function?
#include <stdio.h> #include <stdlib.h> #define NUM_NOTAS 5 #define TAM_NOME 20 struct Aluno{ char nome[TAM_NOME]; int numero; int notas[NUM_NOTAS]; }; void preenche(struct Aluno*…
-
0
votes1
answer544
viewsQ: Error: assignment of Member '' in read-only Object
#include <stdio.h> #include <stdlib.h> typedef struct Ecoponto{ int codigo; int contentores[3]; char *cidade; char *rua; int nporta; }ecoponto; int insereEcoponto (const struct Ecoponto…
-
-1
votes2
answers159
viewsQ: I can’t keep the string
void ex51(char *nome_ficheiro){//escrever e criar um ficheiro novo. char frase[100]; printf("Introduza o texto que quer escrever neste ficheiro:\n"); scanf("%s",frase); FILE…