#include <stdio.h> void hello() { printf("hello world\n"); } int main() { void *(*gibberish)() = (void *(*)())hello; (*gibberish)(); voi
I already know that there is no way to know if a pointer target still a valid allocation of it's already freed, so I'm trying to use pointer to pointer to solve
I want to pass and return a 2D array of unknown size but I donot know how to do it. I know how to only return array of unknown size only (array of pointers). I
For example: temp->next = NULL is same as (*temp).next = NULL list->next->next = temp is same as ??
I have learned that pointers can be declared in 3 different ways: int* a; int *b; int * c; I prefer: int* a; While declaring a pointer to a structure, is it c
In my function, a memory pointer and its size are passed as parameters: int myFun(uintptr_t* mem_ptr, int mem_size) { // Code here } Is there any way to te
#include<iostream> #include<vector> using namespace std; int main(int argc,char** argv){ int n; if(argc>1) n=argv[0]; int* stuff=new int[n];
I do a pokemon project with a Qt interface. I created a class Trainer and Pokemon : class Pokemon { protected: string itsName; doub
As you can see it is giving me 1 but why? When i do t-p then it gives me -1 . Why ? int f=4, o=8; int *p, *t; p = &f; t = &o; printf("Difference betwee
Is there a concept like a pointer to a string in javascript? Or how would this be done? let s1 = "hi"; let s2 = "bye"; // I want to write my code like this [,]
I'm trying to create a program which the user inputs the number of items (rows) and give each one of them a name (scanf) with the max of 30 characters. I want t
I'm trying to get a better understanding of the C standard. In particular I am interested in how pointer arithmetic might work in an implementation for an unusu
Here is the scenario: I have an array, AllElements of structure ElementSet, and inside of that structure - is a set of myElement structures and also an array of
Im using c++ 11, I need to save/load array to and from file. Its the battleship game its need to be done for both user and computer array but i have no idea how
I am trying to read input.txt file, and trying to put each line into the array as string (later on I will use each element of array in initializing obj that's w
I read about std::is_pointer in C++. Then I wrote the program and check whether T is a pointer type or not using std::is_pointer. #include <iostream> i
I have a source pointer (pSource) and a goal pointer (pGoal). I also have a number of characters (n) that need to be copied to the pGoal from pSource. I thought
#include <iostream> #include <new> const int BUF = 512; const int N = 5; char buffer[BUF]; int main(){ using n
I am trying to use dlopen() and dlsym() in my code and compile it with gcc. Here is the first file. /* main.c */ #include <dlfcn.h> int main() { v
As far as I understand int* p = new int(); Is something like creating an int with a constructor. If so why does the following code work like an array? int* p =