Category : pointers

I understand how linked lists work but this particular code is tough to grasp for me. Its this leetcode problem (basically we are given address of a node which is to be deleted) whose solution can be implemented like the code snippet below: class Solution { public: void deleteNode(ListNode* node) { ListNode* next = node->next; ..

Read more

I hope the wording on title is correct. I have such an object in my header file std::vector<std::vector<float>> *sub; //! and in the main.cxx file it is defined as sub=0; mySetBranchAddress(tree,"sub",&sub); I want to iterate over and cout everything in another cxx file and I tried for(uint subIdx=0; subIdx < main->sub->size(); subIdx++){ for(uint subIdx2=0; subIdx2 ..

Read more

i have issues with my programm. When i launch the programm,the console don’ t show the 2 numbers that it should ,instead it only shows this: Process returned -1073741819 (0xC0000005) execution time : 1.759 s This is my code: #include <stdio.h> #include <string.h> #include <stdlib.h> #include <iostream> Test(int* Ptr) { Ptr=(int*)malloc(8); if(Ptr==0) { printf("malloc errorn"); ..

Read more