Questions tagged as 'c'

1
answer

Working with data received by socket in C

I have a script that receives data via socket made in C, and I'm having trouble working with this data. The data received from the client: "imei: 123123123,23123, tracker, 0.0 ......". I need to receive this data and give an explode type t...
asked by 15.03.2018 / 16:19
2
answers

Price calculation algorithm does not display the result correctly

I'm trying to make an algorithm to calculate what should be paid for a product, considering the normal price tag and the choice of payment condition, but it can not calculate, it will display the value 100. #include < stdio.h > #include...
asked by 09.02.2018 / 18:07
1
answer

Doubt on date manipulation using time.h

I'm studying C and thinking about a problem I came across the need to study the library time.h. Basically, I would like to calculate the difference between two dates without needing to reinvent the wheel. For this I considered 2 hypothetical...
asked by 05.12.2018 / 02:13
4
answers

Printf function is not running after the scanf method

Well my problem is this, I have a program that calculates the area of a circle, here's the code: #include <stdio.h> #define PI 3.14 int main() { double radius; double area; printf("Program to calculate the are of a circle\n")...
asked by 29.04.2018 / 16:35
2
answers

I can not register a person's name in my calendar

I am making a very simple agenda, the numbers I have managed to castrate however the names of the people I could not. My code #include <stdio.h> #include <malloc.h> #define MAX 50 typedef struct { int numero[MAX]; char nom...
asked by 29.06.2018 / 18:57
3
answers

Problem with C

I have [Error] expected expression before '<=' token , with the following code: #include <stdio.h> #include <stdlib.h> int main () { float VS, VF; printf ("valor do salario: "); scanf ("%f", &VS); print...
asked by 03.04.2014 / 17:38
2
answers

Adding a char to a char pointer in C / C ++

I need to add char to a char pointer. For example: I have a pointer of char named name, which receives "log", after the process, I want it to be "log1". I tried to implement this, but it did not work. bool trocarNome(c...
asked by 27.04.2016 / 19:33
2
answers

I can not save 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 *fp=fopen(nome_ficheiro,"w"); if(fp==NULL){ printf("Er...
asked by 27.12.2016 / 15:21
1
answer

Seg Fault Core Dumped [closed]

I'm having this error in the code and I can not find the problem, can someone point me to what I'm doing wrong? What the code does: I get row and column of matrix A, after matrix B, check if they can be multiplied. I get the values of matrix A a...
asked by 24.05.2017 / 02:35
2
answers

Fscanf, fprintf, and printf

I have a problem reading and displaying on the screen. The program will read from the keyboard a series of data, save them in a binary file and then allow the query of how this information is in the bin file, showing them on the screen; #includ...
asked by 24.06.2014 / 21:22