Questions tagged as 'c'

1
answer

Chained List - sorting by selection

I am reproducing a sort ordering algorithm using threaded list. I'm using two loops using a cell min, iej, with respect to cell j, ok, but when changing the min pointers and i is not working, when i change the two, i starts the loop in the po...
asked by 18.11.2015 / 00:54
3
answers

problem in C with remainder of the split [closed]

Develop a program that reads ten elements of a matrix A vector type. Construct a matrix B of the same type, observing the following formation law: if the value of the index is even, the value must be multiplied by 5, being odd, must be added wit...
asked by 22.09.2015 / 16:11
1
answer

Know the line number of a txt file in c

Is there any function or way to find out how many lines a file has, without having to open it? I need to split a file into two parts so that two processes read it at the same time. I will use the fseek () function to move the pointer to a certai...
asked by 21.05.2014 / 00:57
2
answers

Problem loading file in memory

I'm trying to load several files into memory (small files), but the problem is that when I try to load another file soon then all files have the same name as the last file loaded. I'm using a struct that contains name, size of the name...
asked by 17.07.2014 / 00:39
2
answers

How to control the flow when an invalid value is entered?

If I want a condition to be repeated over and over again, how can I use the return command for a specific line? I'll put the program to better explain: #include <stdio.h> #include <stdlib.h> int main() { int aprovados,...
asked by 26.06.2014 / 17:52
2
answers

Function giving wrong values

For some reason, my function of calculating distances is giving wrong values sometimes. Not only that, but the values seem to be from memory addresses (since they are very large), but I'm not sure if that's it. The function: float distancia(in...
asked by 08.12.2014 / 01:15
2
answers

How to get information from one function and use it in another?

I need a program that adds and multiplies as the user chooses and then select the corresponding function that will read the values until the user types 0 and the program generates the result. My program for any value typed is reporting 36. And a...
asked by 18.10.2015 / 01:00
2
answers

"Join" elements of a single vector

I have a vector with four elements that are numbers represented in hexadecimal form. What I need to do is concatenate these four elements (I think this is not the right word but I have not found a better one)? For example: int v[4]={0x...
asked by 24.02.2015 / 22:15
1
answer

Why is my server code not working with IPv6?

Recently I've been writing a small C server using the UNIX sockets API for just a few tests. The program works perfectly with IPv4 , but the same does not happen with IPv6 ... Follow the code: #include <stdio.h> #include <stdl...
asked by 26.10.2018 / 15:55
2
answers

Recursive Palindrome C

My functions are not working correctly, the program always tells me that it is not palindrome, for any situation. Here is the code: #include<stdio.h> #include<string.h> int inverte (char *n, int y, int aux) { if (y <= au...
asked by 16.01.2017 / 13:16