Questions tagged as 'c'

1
answer

Segmentation fault in function read_line

I have a function that returns a string of a line from a file, but when I execute it, I get a segmentation fault message. Here's the code: #include <stdio.h> #include <malloc.h> #include <string.h> #include "parser.h" const...
asked by 09.06.2018 / 21:09
0
answers

C language and RubyInstaller with system variables for windows

I am a Linux user. However I do not need to depend on a single operating system environment to perform C routines, much less still depend on IDE for certain tasks. On Linux (most of the distros I've worked with), the gcc compiler is already inst...
asked by 21.06.2018 / 15:17
0
answers

How to use dates in C?

I wanted to know how to implement the time.h library The application must identify the client, the start and end date of the rental, and price paid for the rental and the payment date. We have the following structures: typedef struct Alu...
asked by 11.06.2018 / 22:28
0
answers

Language C - Create Array of Dynamic Strings and Iterate by values [duplicate]

Good afternoon, guys. Despite having researched extensively on the Internet, I could not understand the concept of creating Dynamic Strings Arrays. I need to store some strings (I do not know the amount beforehand) and iterate through the "...
asked by 11.06.2018 / 23:06
0
answers

Using keyboard with Ncurses

I already know that to do the key I have to use the getch () example While (getch (C)! = 27); But I wanted to know how to use with example key junction Ctrl + O, Ctrl + X ... Etc     
asked by 31.05.2018 / 03:02
1
answer

How to do searches in txt Files in C?

I am a beginner in programming, and I have a job to deliver to college. In it I have to make customer records using files, and then do a search on the file and print on the screen the data of the registered customer. However, I am not able to pe...
asked by 31.05.2018 / 14:27
0
answers

Error: Segmentation fault - Dynamic allocation of arrays

I want to use this function to dynamically allocate and fill an array, of indeterminate size, where each row has two elements only, that is, an ordered pair. int **lePares() { int **pares = (int **) malloc (sizeof(int *)); // Aloco uma "ma...
asked by 29.05.2018 / 19:10
0
answers

Separate a string in 2 from a file

I'm having difficulty separating a query string from one file into two. the file is so alex 6461 anddre 979794 douglas 6469794 gustavo ... I want to get the characters I get in the line and divide it into 2 strings so name: alex tel: 6461....
asked by 28.05.2018 / 22:37
0
answers

Removal List Double-chained C

Can anyone help me with the issue of removing a node from the linked list? I am not able to remove the elements correctly, only the last added to the list. #include<stdio.h> #include<stdlib.h> #define MAX 50 typedef struct {...
asked by 29.05.2018 / 01:00
0
answers

Two-dimensional Matrix in C [duplicate]

I have a product registration in C. Products can be up to 30 characters (columns), but can be infinite in quantity (lines). In the variable declaration, I used:    char products [] [30]; However, when compiling, it returns that the...
asked by 05.06.2018 / 14:37