Category "c"

String Pattern Matching in C

I was trying this pattern matching method in C but whenever I give all the input, the vscode terminal waits for a while and just stops the program without any w

Can I change the focus behavior of child windows?

Using fairly run of the mill window creation code for child windows I get (the infamous) "focus follows mouse" behavior in Xwindow, that is, the keyboard entrie

Is it possible to write different types of elements in the array?

I learn C programing now. Is it possible to write both numbers and letters in an array? Can you give an example if possible?

trouble with linked list bubble sort

I am a beginner learning to make bubble sort work with linked lists. I saw a geeksforgeeks page talking about this (https://www.geeksforgeeks.org/bubble-sort-fo

How to wait and READ char from stdin without waiting?

Hello There is a file where I draw picture using a loop. I want to exit loop when 'q' button is pressed. But I want the program is running during it is waiting

Assertion `argc >= 2' failed. Abandon (core dumped)

I'm traying to calculat the multiplication of tow matrix using OPENCL with C: ` #include <CL/cl.h> # include <stdio.h> # include <math.h> # in

Run powershell scripts from a C program

I'm creating a C program to run several powershell scripts. But when I run the command with the system function it opens the script in a txt file instead of run

Create a linked list with the characters of a string-C90

The problem : I am trying to create a linked list which contains the characters of a string in each field of the linked list(to get the distance of each letter

perf mem doesn't records mem load on heap

I used perf mem on my test C program, because I want to get how many times the mem load(and store) on the same pages. a. My C program is here: "stest.c" #includ

I’m trying to sum the return value of 2 threads together but it return -1 saying error

I’m trying to make a program which sums the numbers in an array, the first half of the array by the first thread and the second half by the second thread

Time Complexity of Split AVL Tree Function

I have the following code for splitting the AVL tree and I'm not quite sure if it has Time Complexity of O(log(n)) or O((log n)2). Note: The Complexity of join

errno vs errors returned by library functions

For errno, there are a bunch of library functions, like strerror(), etc. to convert or print the error code. But what about the error codes re

How to know if the file end with a new line character or not

I'm trying to input a line at the end of a file that has the following shape "1 :1 :1 :1" , so at some point the file may have a new line character at the end o

How to get the i-th element of vector

I want to get the i-th element of the void*. I understand that it is void type and I have to give it a certain data type. The idea behind this is that it should

Multiple problems with Sobel algorithm in c

I'm trying to build an edge detection program using the code below. I have faced a variety of problems though, that I don't know how to solve. #include <stdl

C programming issues, GTK assertion problem

I am posting this question because I have a problem with my beginner programming project. I am new in the use of gtk and I am blocked by a problem that I wish t

Can using volatile affect the behavior of simple property checking system?

I'm maintaining a project where someone has suggested that we make some variables volatile. I'm trying to understand if it's needed at all (or could be needed).

Quick sort in function

Task: using the function of generating an array to a file, the function of reading an this array, and the quick sort function, sort the read array. I wrote all

Length of array in function argument

This is well known code to compute array length in C: sizeof(array)/sizeof(type) But I can't seem to find out the length of the array passed as an argument t

Which C/C++ data type should I use for PHI(N) calculator?

I found a source code online for calculating PHI. I made some small adjustments to the variable types, such as using an unsigned long int, however I am limited