Skip to content
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms and Conditions

Programming Tutorial

Start Learning to Code

  • About Us
  • Contact Us
  • Privacy Policy
  • Terms and Conditions

Breaking News

Nextjs: running code after complete fetch

why does 400 status code result always entercatch block execution with axios?

Saving the state of the button onClick

TypeScript: Specify that value must be in Array using spread operator

Show separate number with comma in django tempalte

Why does my website keep showing old index.html, style.css, app.js…?

Using Python Flask to change the colour of an icon when it detects a words like scam, pending and verified

x clear icon appears only when the input has value – react

Login button redirects to two pages. For first time loginers, it redirects to agreement page, and for rest, it redirects straight to home?

WebComponent setter not triggered if defer is used

Tag: malloc

Linux

calling alloca( ) from another function call parameter?

admin September 16, 2020

Why calling alloc( ) as a parameter to another function call like this func(x, alloca(size), z); is considered wrong According to a book called the linux programming interface This is because the …

allocalinuxmalloc
Linux

Why malloc doesn’t allocate memory until I hit a certain threshold?

admin August 2, 2020

#include #include #include int main(int argc, char *argv[]) { size_t sz = atol(argv[1]); char *arr = malloc(sz); sleep(10); }…

cdynamic-memory-allocationlinuxmalloc
Arrays

Cannot print out the values of a dynamic 2D array of structs

admin March 13, 2020

This program is supposed to ask the user for two values, then generate and print a table using the two values as the number of rows and columns respectively. Each cell of the table has two values, …

arrayscmallocprintfstruct
Arrays

C – how to add a char to an array [closed]

admin February 14, 2020

I’m trying to figure out how to add a simple char to an array created with malloc. #include #include int main() { char *array = malloc(2); array[0] = “h”; …

arraysccharmallocpointers
Linux

C memalloc & mempy give conditional jump valgrind error while splitting a char array

admin December 24, 2019

I am trying to split this char array into two parts first 4 character is one part rest is second part Its working but I get conditional jump issue on valgrind can any one advice the solution to this …

clinuxmallocmemcpyvalgrind
Arrays

C Programming: malloc() inside a function

admin March 16, 2019

I would like to allocate memory in a function and then use that space in the main(). All is fine in the function, but I never can access the data in the main(). There are two memory allocation …

arrayscfunctionmallocpointers
Arrays

Malloc large space of struct and accessing it like arrays in c

admin January 21, 2019

I’m dealing with implementing a hash table. My understanding of a hashtable is that is that to have an array like table where you’re able to access the elements quickly by getting the hash value and …

arrayscdynamichashmalloc
Linux

What should use mmap, malloc or File I/O

admin November 3, 2018

Background Our kernel level program invokes a process in user space for making some decisions on the basis of values in a file. The user space program is a short lived process that compares value …

cfilelinuxmallocmmap
Arrays

Free a single element from a dynamic array in C

admin July 24, 2018

I have a problem in a C program: I would like to free the first element from a dynamic array but I don’t know if it is possible nor how I could do it. For instance if I allocate an array A made of 10 …

arrayscfreemalloc
Arrays

How to malloc a block size of UINT_MAX? [closed]

admin September 28, 2017

I want to create an array with exactly UINT_MAX number of indexes. This has been extremely hard for some reason. I’ve tried the following: char arr[UINT_MAX]; // Compiler claims array size cannot be …

arrayscmalloc

Posts navigation

1 2 3 Next
Privacy Policy