Questions tagged as 'c'

1
answer

Error in C regarding libraries

#include <stdio.h> #include <ctype.h> main() { char palabra[32]; char ordenado[32]; int longitud; int i; int j; char x; printf("Dame una palabra:\n"); scanf("%s",palabra); longitud=strlen(palabra)...
asked by 17.04.2017 / 15:15
2
answers

Restart or close a program by entering a word in C?

I have this code, the program does its thing and when it ends it indicates that to continue the 0 is entered or to close any other number, what I want to do is that to continue enter the word 'continue' or follow 'and to close the word 'leave'...
asked by 29.03.2017 / 20:22
2
answers

Calculate and show persistence of a whole [closed]

It's something of a project and I need to add this: Calculate and show the persistence of a given whole number. The persistence of a Number is the number of times you have to multiply the digits of a number until it becomes a single-digit num...
asked by 07.11.2016 / 00:53
2
answers

Problem with a variable in C

Good I have the following code, in which I have to calculate and visualize the sum and the product of the even numbers between 20 and 400 both inclusive. The product always shows me 0. #include <stdio.h> int main() { int n=20; i...
asked by 04.10.2017 / 19:57
1
answer

Pointer to struct in ansi C

I have defined the following globally. char buffer[32+1]; TOKEN tokenActual; int flagToken = 0; typedef enum{ INICIO, FIN, LEER, ESCRIBIR, ID, CONSTANTE, PARENIZQUIERDO, PARENDERECHO, PUNTOYCOMA, COMA, ASIGNACION, SUMA, RESTA, FDT,...
asked by 20.10.2017 / 17:14
1
answer

Differences between execv () and system () function in C

I'm doing a command interpreter in C and I have a problem with the execv function. I use a method called readCommand to read a text string and divide it into an array with the command and parameters. Then I pass to the functio...
asked by 16.12.2016 / 23:52
3
answers

Is there a sleep function for float in C?

My question was if you knew any function that does the same thing as sleep for 0.5 or 0.25 seconds. That is, if there is something like sleep(0.25); since the function sleep does not work because it only applies to integers....
asked by 26.12.2016 / 19:40
1
answer

Read / write char arrays in binary files

I am trying to binary save strings from static character arrays and then print them. The point is that, in spite of the fact that I assign them the value in a static way (so when creating them, they should be created with the %code% at th...
asked by 05.04.2018 / 10:54
1
answer

Windows API - Read / Write from the Serial port

I'm trying to send an AT command to a 3G module whose response is going to be OK. I want to capture that OK in a buffer for its subsequent treaty. For this I did the following: 1- Abri the port according to: hSerial = CreateFile("\\.\COM1",...
asked by 22.02.2018 / 16:42
1
answer

How to deal with a bidimesional array passed by pointer? C

As the title says, I can treat a two-dimensional array passed by pointer, an example to clarify my idea: main() { char array[10][10]; llenar_array(array); } void llenar_array(char *array[]) { char registro[10] = "Cadena"; //Sin punteros ser...
asked by 29.08.2017 / 03:41