Category "c"

Save page of WebKitWebView into file

I have this almost solved. I've found this function: void webkit_web_view_save_to_file (WebKitWebView *web_view, GFile *file,

Which all multicast groups are available under custom netlink protocol

I am trying to send a notification message from a kernel module to user space application using netlink sockets interface and custom netlink protocol. My unders

How to use dynamic 2d array inside a struct array in C?

What do I want to do? I'm working on a project on dynamic matrix multiplication. I want to input from the user that on how many matrices, he/she wants to perfor

cannot cast 'float64' to different essential type 'unsigned16' [MISRA 2012 Rule 10.8, required]

cannot cast 'float64' to different essential type 'unsigned16' [MISRA 2012 Rule 10.8, required] double x, y; #define MIN 2.0 uint16_t z = (uint16_t) ((x * MIN)

The pid works only once after the two calls to scanf

This program creates a pid and shares two integers (base and height) through the shared memory. The parent process time asks four times to insert two integers a

Faced an error: excess elements in char array initializer during print out of array of strings

I've tryed to print out some array of strings but faced error: excess elements in char array initializer Please make a hint what's worng with this code? Step 1

how can i pass string(taken as input from user) to a pointer function in c?

#include<stdio.h> void add(int a,int b) { int c=a+b; printf("\nSum=%d",c); } void hello(char *name) { printf("Hello %s",*name); } int main() {

Binary search program cause runtime error and failed hidden test cases

I am practicing binary search with problem 704 on leetcode. At first, I just follow the concept of binary search and came up with this solution: int search(int*

Different output on recursive call using static variable [closed]

int fun1(int x){ static int n; n = 0; if(x > 0){ n++; return fun1(x-1)+n; } return 0; } int fun(int x){

What is the difference between using INTXX_C macros and performing type cast to literals?

For example this code is broken (I've just fixed it in actual code..). uint64_t a = 1 << 60 It can be fixed as, uint64_t a = (uint64_t)1 << 60 but

OpenVAS libgvm_util.so: undefined reference to `MQTTClient_`

Have some troubles in compiling from source https://github.com/greenbone/openvas.git cmake was done successfully, but make failed with: /usr/bin/ld: /opt/gvm/li

Having problem Understanding fork() hierarchy tree

I have this Code that I can't understand. I understood the basics of fork() but I don't understand the Hierarchical tree for this process. The code is like this

OpenSSL BIO_read is wrong

This is the code how I am reading the response from my HTTPS request: int len = 0; f = fopen("response.txt", "wb"); do { char buff[1534]; len = BIO_read

why does malloc not taking in the full text? [duplicate]

Why is it when I try to take in a text in the variable is does not store in the full sentence. The malloc seems to not allocate enough memory

c program doesn't takes "space" as input to show the acsii code

The program shows output for all other characters instead of space. When I enter "space" it doesn't do anything and just waits. #include<stdio.h> #include

Linux getenv() could not get $PS1 or $PS2

My home world is to write a shell. and I must use $PS2. but when I write a code like this: char *ENV_ps2; ENV_ps2 = getenv("PS2"); I just found ENV_ps2 was

How to delete or clear all the messages from the POSIX message queue in c?

I want to delete all the messages from the POSIX message queue. I searched on the internet but I didn't find any way to do it instead I found the way to delete

What value does the compiler assign to an uninitialised member of a const struct in C?

Say I have a struct typedef that is: typedef struct { int32_t memberOne; int32_t memberTwo; } myStruct_t; I instantiate a const of that type as follows

Why does GCC include an "empty" XOR

I have following piece of code: typedef struct { int x; int y; int z; int w; } s32x4; s32x4 f() { s32x4 v; v.x

does pthread_join affects concurrently

I want to run all threads concurrently. If I use pthread_join function does it affect running of threads concurrently? pthread_join(..)