Questions tagged as 'c'

1
answer

Doubt about pointer to structure in TCP / IP connections

I have the following code: // IPv6: struct sockaddr_in6 ip6addr; int s; ip6addr.sin6_family = AF_INET6; ip6addr.sin6_port = htons(4950); inet_pton(AF_INET6, "2001:db8:8714:3a90::12", &ip6addr.sin6_addr); s = socket(PF_INET6, SOCK_STREAM,...
asked by 18.05.2018 / 00:51
1
answer

How can I solve the warning "assignment from incompatible pointer type"

I'm doing this program in C about signals, but when compiling it I get this warning:    practica8.c: In function 'main':       practica8.c: 18: 17: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]       act....
asked by 27.04.2018 / 04:25
1
answer

Write to a file mapped in memory (using mmap)

I'm trying to learn how to use mmap; I have managed to read from a file mapped in memory, however when trying to write I constantly get a "segmentation fault". The code (to write) that fails me is the following: #include <stdlib.h> #in...
asked by 20.02.2018 / 13:23
1
answer

Validate Data in c ++

I need to validate the numerical data entry in c ++, I am using: #include<iostream> #include<stdio.h> using namespace std; int main() { int dato; cout<<"Ingrese un valor para dato: "; while( ( cin>>dato )...
asked by 14.10.2017 / 13:53
1
answer

warning: assignment from incompatible pointer type

Where am I missing? int (*funcion_c)(void*,void*); int f_comparador(int* n1, int* n2){ //Implementación... } funcion_c=f_comparador; //WARNING     
asked by 09.10.2017 / 22:43
2
answers

Declare type of data structure

#include <stdio.h> #include <stdlib.h> #include <conio.h> struct estudiante { int ced; int aniocarrera; char grupo; }; estudiante e; //<-error: unknown type name 'estudiante' int I; void ingresar(estudiante* e) {...
asked by 01.09.2017 / 22:47
2
answers

C: how to assign char * to const char * const *

A function returns a certain number of strings ( uint_32 extensions_count ) and I have to assign each of them in const char* const* extensions . The chains are in this structure: typedef struct VkExtensionProperties { char...
asked by 01.08.2017 / 16:18
1
answer

Split IP into host part and network into c

I am doing a program in c to divide an IP into the host and network parts, I have the following code: #include <stdio.h> #include <stdlib.h> #include <netinet/in.h> #include <arpa/inet.h> int main(){ struct in_addr ad...
asked by 23.09.2017 / 14:21
2
answers

Error executing when using scanf

I can not execute any program that carries calculation operations in all the compilers that I have installed in my Computer. #include<stdlib.h> #include<stdio.h> int main(){ int num,tot; printf("Ingrese un Numero:");...
asked by 22.05.2017 / 21:06
1
answer

ALGORITHM PARTITION QS

They could guide me how this algorithm works     
asked by 22.05.2017 / 01:58