Questions tagged as 'c'

3
answers

IF multiple does not work

I've tried this and it always works, enter the number that is if(i==(1|2|3|4|5)){ printf("me ha llegado un numero del 1 al 5"); } alternatives?     
asked by 15.04.2017 / 14:15
1
answer

K simo element in an ABB search binary tree

I'm having trouble doing a function that finds the item with position k inside a binary search tree (ABB). I have to go through it in order, that is, left, root, right. So far I have this code but it gives me Segmentation fault. If you have anot...
asked by 24.04.2017 / 14:16
1
answer

Search for repeated numbers c

I have the following exercise: Given a square matrix of whole numbers between 1 and 100 write a something- rhythm that detects all the numbers that are repeated and replace them by zero, indicating how many there are without repeating I tr...
asked by 25.03.2017 / 01:13
1
answer

Convert Array char to FILE pointer in C

This is working with the PEM_read_PrivateKey () function EVP_PKEY *PEM_read_PrivateKey(FILE *fp, EVP_PKEY **x,pem_password_cb *cb, void *u); of OpenSSL and I want to pass the first argument directly with Array from the Key file, for example...
asked by 30.12.2016 / 01:05
1
answer

Filter interfaces depending on what is required in linux with C

and with help from here I was able to obtain a program that lists all the network interfaces, the program is as follows: #define _GNU_SOURCE /* To get defns of NI_MAXSERV and NI_MAXHOST */ #include <arpa/inet.h> #include <sys/sock...
asked by 01.12.2016 / 00:09
1
answer

Help with Commands - C

The idea is, from the entry of a pid by the user, stop it, but it is not working, do you have any ideas? #include <stdio.h> int main() { char proceso; char command; for(;;){ command="kill "; printf( "Aca listo los procesos" );...
asked by 06.12.2016 / 18:28
3
answers

Help with basic C exercise

I am beginning to study the c language and I need some help with this exercise. It's almost all done and just need to compile it and see if it works, but I'm not sure how to do the last part. When option 4 of the menu is chosen, the progra...
asked by 11.12.2016 / 01:32
2
answers

Language C on Linux: chdir returns value -1 always

The following function receives an array of strings ( **args ) and, specifically, args[1] would contain the path when executing the line. This function is part of a program that has a method to read a line from the terminal and a...
asked by 16.11.2016 / 23:51
1
answer

helps files in C

I need to create a program that writes a file of bytes , with the name that is entered, with a number and ask if that number is Mb or Gb and I already have the following code developed, although I think that is not the best w...
asked by 17.11.2016 / 22:15
1
answer

checksum issues

I am trying to generate the checksum of an icmpv6 package as an example. This is the function that I am using: uint16_t checksum (uint16_t *addr, int len) { int count = len; register uint32_t sum = 0; uint16_t answer = 0;...
asked by 15.11.2016 / 22:20