//Program is to collect input from user so that can pass the array of inputs from the user to another print function but that are quite some Errors in the code
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
I have this pointer in a class: std::array<std::array<std::array<Item*, XSize>, YSize>, ZSize>* Items; In the constructor: Items = new std::a
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
I have the following code. I tried to change the value of y by using a pointer to a pointer (i.e. trying to do a de-referencing twice from the pointer that poin
Here is my exercise: Write a function that receives from the user two strings that show two real numbers (possibly negative), And produces a string that contai
I have a code chunk which is quite meaningless for me. Is there someone can explain it to me? Thanks int strLength(char *str) { char *p = str; // Go until the e
#include<stdio.h> #include<stdlib.h> void insert_front(struct node* head, int block_number); void insert_rear(struct node* head,
Long story short, I have a pointer to a value that is stored inverted, so when we are calculating a hash to verify data integrety, we need to invert the data th
In plain C, pointers to void are useful as arguments to generic functions, such as a generic quicksort, or a generic swap, etc., as seen here: Implementation of
I have read that converting a function pointer to a data pointer and vice versa works on most platforms but is not guaranteed to work. Why is this the case? Sho
I have this typedef and struct: typedef double mat[MAT_SIZE][MAT_SIZE]; typedef struct matList { char *name; mat *matrix; } matList; and I create an a
I am new to programing, and I found one interesting but difficult to find reason problem, so I am writing this post. I was trying to write swap function: When I
I get rather poorly optimized assembly with gfortran 11.2 when using array pointers, even in seemingly very simple cases. For example, the optimized code (https
As Joel points out in Stack Overflow podcast #34, in C Programming Language (aka: K & R), there is mention of this property of arrays in C: a[5] == 5[a] Jo
I have a pretty simple python-3 code that is puzzling me. test.py : import numpy as np class PARTICLE: def __init__(self, PosV = np.zeros(3), Mass=0):
I am unsure what André Caron means here: Virtual functions in C ... some of this code relies on (officially) non-standard behavior that "just happens" t
I want to have a class with a constant pointer to a function as a member. However, I'm instead creating functions with constant return values (a strange feature
Im trying to implement a simple LinkedList class, but this error shows up and I don't understand why. struct Node { public: int val; Node* next; Nod
i have this typedef of two dinantial array, and strust the keep his adress typedef double mat[MAT_SIZE][MAT_SIZE]; typedef struct matList { char *name;