Questions tagged as 'c'

2
answers

Structs not fed

Dear C programmers, good evening, I ask them for help in the following case: I want to feed an array of structs to each interaction in a row of a file, the problem is that although I can read the file line, I can not send the data to the stru...
asked by 15.11.2017 / 02:38
1
answer

Program runs but does not respond

I am programming a simple TCP / IP server in Linux, but after running it in the terminal, I get no response, not even print a line that should print at the beginning of the program. When compiling gives no indication of errors and / or warnings....
asked by 25.03.2015 / 17:00
1
answer

Opening and reading giant files in C

How can I open a file for C language reading, over 100 MB? With this code below, I can read a file with more than 18,000 lines, but what I really need is to read a file with approximately 5,000,000 lines. Is this possible in C? char **xx...
asked by 14.12.2014 / 18:10
1
answer

How to Assign a Phrase to a row in an array of chars?

I want to modify standard phrases from a theoretical game. For example, the game has the phrase "Choose a command" and, over a given state, you would like to change all the letters "o" and "a" by an @. For this, I thought about implementing a...
asked by 04.10.2018 / 18:26
1
answer

Pointers in C language

I created a simple code with the function void where there is a passage by reference. However, it is giving the following error at compile time:    lala.c: In function 'main':       lala.c: 19: 12: warning: passing argument 2 of 'test...
asked by 24.10.2018 / 04:16
3
answers

Print Vector in C

I would like to start a vector [300] and another [500], but in a way that looks like an array for the user ... for example, I made one of [100], where I looped to start this vector and an "if" for it to break the line so that when it arrived in...
asked by 13.12.2018 / 03:00
1
answer

Recursive function in c

Implement the recursive function form (n): returns the value of the sum of i * i, with i varying from 1 to n. I've tried it here, but it's not right: include <stdio.h> include <stdlib.h> int form(int n){ if(n==1){...
asked by 16.09.2018 / 01:27
1
answer

Queues with checks and customers

I want to create a queue or check pool .. like a Queue standby (FIFO) and I have some difficulties. For now the code I have is giving me some errors. I'm having gender errors: Item.h:16:16: warning: struct has no members [-Wpedantic] Item...
asked by 11.05.2015 / 11:54
2
answers

Count letter and pick up initials of name

The program does not print the first letter of each name. nome[i]=nome[i+1]; I need to make a program that enters the name of the person, say how many letters A has that person's name and say the first letter of their names, for exam...
asked by 22.11.2017 / 21:37
2
answers

String comparison in C

How could I print the variable sex out of if-else (it has to be OUT of it). This code is printing blank and I can not understand why. #include <stdio.h> #include <stdlib.h> #include <locale.h> #include <string....
asked by 20.10.2017 / 00:47