Questions tagged as 'c'

1
answer

Insert element in ordered vector C

I would be looking for a function that inserts a number in an array already sorted in ascending order. For example, if I have an array of 5 pre-initialized elements with: 1,3,5,7,9 And I want to insert a 4, should be 1,3,4,5,7 Removing 9....
asked by 06.09.2018 / 17:16
1
answer

How to ignore part of the file in c

I need to know how to ignore the first rows of a txt in c such as: AQJAS KJSA KSJA 1 2 3 123235 In that example I want to read from 1 forward, how can I ignore those characters above thanks.     
asked by 27.08.2018 / 22:36
1
answer

Is there any way to make switch c ++ in visual basic console?

while(contador <= 15) { factor *= contador; switch(contador){ case 1: f1 = factor; break; case 2: f2 = factor; break; case 3:...
asked by 05.08.2018 / 20:40
1
answer

VIBORITA / SNAKE .. game developed in a matrix: it does not print with the modifications of rows and columns

Always print the matrix and the vibora in the initial position that I established, it does not move. I thought that with lines like the following I am modifying the number of rows and columns, but I do not print the little vibration with the mod...
asked by 03.08.2018 / 02:39
0
answers

How do I create a vehicle program with struct in C?

In my project I must create a program that has a menu where I have two options. In the first "List all versions of a vehicle" in which I must enter who made it (toyota, suzuki, etc) and the name of the model, giving me as a result and in the...
asked by 03.08.2018 / 23:32
2
answers

How could the user enter the following data only on a line not as in the code and validate it?

do{ do{ printf("Punto 1 A\n"); //X1 scanf("%d",&a1); if(a1<0 || a1>10000) { printf("\nError el Numero Debe ser mayor a 0 y menor a 10.000\n"); } }while(a1&l...
asked by 24.07.2018 / 21:47
1
answer

Reading files in c

#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct pila{ int clave; char nombre[50]; float salario; struct pila *psig; }pila; pila *pmaestro; pila *NuevoElem(); void push(int clave,char nombr...
asked by 03.08.2018 / 00:29
2
answers

Read line of text file with fixed format

I'm not sure which is the best way to read The following text file which was generated in the following way: Struct int nro_orden; char desc[30]; int cantidad; fprintf(pf,"%03d%-30s%03d\n",pedido[i].nro_orden,pedido[i].desc,pedido[i].cant...
asked by 15.07.2018 / 22:12
2
answers

character vector

The exercise asks to, from a vector with a phrase, show its content in gibberish (it has to go through the arrangement, when it finds a vowel, it adds p + vocal example: hidden: e eg sco po ndi pi do po). I did it with a switch, but it's...
asked by 13.07.2018 / 19:43
1
answer

create a typedef of struct and use functions to request data

The error tells me:    could not convert '(Person) (& p) from' Person * 'to' Person ' struct Persona{ char nombre[20]; int edad; };typedef struct Persona arreglo [5]; Persona cargarArreglo(Persona); void Imprimir(Persona); int mai...
asked by 03.07.2018 / 00:29