Questions tagged as 'c'

2
answers

First letter of a word in C

I need to make a program that takes out the first letter of a word through a function in C, without using characteristics of Arrays. I have this code: #include <stdio.h> #include <string.h> char dimeLetra(char[]); int main(){...
asked by 21.10.2018 / 01:15
1
answer

hello what error does this code have to call hexValid twice and read 4 hexadecimal characters [closed]

/* **Fichero: hexDec3.c ** Autor: Francisco Javier Peña Higueras ** Fecha: 5-11-2018 ** **Descripcion:Realiza el cambio de dos dígitos hexadecimales a decimales ** */ #include <stdio.h> #define CTE 16 #define SINERROR 0 #define CONERROR 1 #...
asked by 18.11.2018 / 09:54
1
answer

You doubt scan character C

I'm starting with C and although I know I should do it, I do not understand why I should put a line break before scanning the character. scanf (" \ n % c", & c) #include <stdio.h> int main() { printf("Cadena: "); scanf("%s",...
asked by 18.11.2018 / 18:07
1
answer

Dev c ++ does not give the correct result

Afternoons or Nights I have a problem in doing this problem in Dev c ++ that when I run the program it throws an illogical result and I do not know why this error is due I would appreciate a response from you. Thanks     
asked by 13.10.2018 / 21:28
2
answers

Problem with functions - Find item in a fix

How about, very good day, I've been starting to program, and I've had a problem with a program regarding functions. It turns out that they ask me to make a program that stores elements in an array, and then asks the user to enter a number to...
asked by 14.12.2016 / 00:16
1
answer

Save data using a struct

I want to save the times of the athletes in minutes and seconds. For that, I made a time struct. But I have two problems: I keep only the last data entered. When I ask you to control that the user does not enter more than 59 minutes, or se...
asked by 25.07.2018 / 16:32
2
answers

Error in structure fix using functions

I got the following error    44 33 C: \ Users \ Miguel \ Desktop \ ss.cpp [Error] could not convert '(STUDENT *) (& NEW)' from 'STUDENT *' to 'STUDENT' #include <stdio.h> #include <stdlib.h> #include <string.h> struct AL...
asked by 07.09.2018 / 20:10
1
answer

Why does my program fail just before it ends?

Encode this program that consists of reading 2 matrices of whole numbers, adding the values that do not belong to the diagonal of each matrix and in the end determining if said averages are the same or different. The fact is that once he give...
asked by 16.05.2018 / 01:18
3
answers

Save text files in vectors

I have the following code #include <stdio.h> #include <string.h> int main() { FILE *fp1; FILE *fp2; int i,j; int bin[7], dec[70]; int c; fp1 = fopen("bin.txt", "r"); //Abrimo el archivo fp2 = fopen("dec.txt","r")...
asked by 03.07.2017 / 17:29
2
answers

Clear screen on Mac. Language C [closed]

I was wondering if the system(“clear”); function works on Mac or, if not, is there a different one for this operating system? Since I only have Linux to try! Thanks!     
asked by 21.05.2018 / 00:34