python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How to correctly use realloc in a seperate function?
Resizing memory in a separate function causes a memory leak.
Separated into two functions and leaky:
#include <stdio.h>
#include <stdlib.h>
void memo(int* list);
int main (void)
{
in...
Johann Smith
Votes: 0
Answers: 0
Realloc + memcpy 2D float array results in segmentation fault
I made a structure (SomeMisc) which has a float array, so I can fill it with some values, and then try to memcpy its float array to a different struct's float array, and print out the result to see if...
user326964
Votes: 0
Answers: 1
i try to allocated with realloc function and get error
typedef struct{
char** strings_cmd;
int size_cmd;
}parseInfo;
....
parseInfo* parse(char* cmd){
char* temp = strdup(cmd);
char* temp_split = strtok(temp," ");
int i = 0;
...
Roni Jack Vituli
Votes: 0
Answers: 2
How to dynamically allocate memory for words stored in an array?
I input words one by one from the screen and send them to an array. I can, of course, immediately allocate large memory for the array, but I would like to allocate memory for this dynamically.
For exa...
Khimer
Votes: 0
Answers: 1