No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
int const & refToConst = i; // OK int & const constRef = i; // Error the "const" is redundant what is the difference between the two ..? |
|
Hi Guys. I tried creating an insert into tree datastructure which is causing core dump. Please identify the issue... Here is the code [code] #include<iostream> #include<string> #include<stdlib.h> using namespace std; //Global Data struct Tree { Tree* right; Tree* left; int element; }; typedef struct Tree* TreeData; //Function Declaration void insert(TreeData … |
|
I tried out this sample program [CODE]int main() { int *i=new int; return 0; } [/CODE] The return type of new is a void pointer . Pasted below [iCODE]void* operator new(std::size_t);[/iCODE] [iCODE]int *i=new int;[/iCODE] new int in the above statement should return void pointer . How can a void pointer … |
|
[CODE]#include<iostream> #include<stdio.h> using namespace std; int main() { for(int i=0;i<10;i++) { char *a=new char[10]; printf("%u\n",a); } return 0; }[/CODE] This is the output that i got 5377864 5377888 5377912 5377936 5377960 5377984 5378008 5378032 5378056 5378080 why the memory is increased in size of 24? |