Posts

Showing posts from July, 2010

C++ Array vs Object - Pass by value

You can not pass an array by "pass by value", whereas objects can be passed by value. Here is a snippet: You can pass an array to a function in only following manner: int arr[2] = {0,1}; void s(int arr[]){ //This statement is equivalent to: void s(int *arr) arr[0]=2; } s(arr); // This passes array pointer by value and hence the complete is passed by reference. Meaning to say function s will operate on real array and not on a "copied" array of the one passed in argument. You can pass an object to a function in two ways: void s(Obj* o) // this statement is equivalent to: void s(Obj & o). Pass by reference void s(Obj o) // Pass by value. The actual ojbect passed as parameter when invoking the function, gets copied and function acts on copied object and not on actual object

C++: Char vs String initialization

#include "iostream" // a PREPROCESSOR directive using namespace std; int main() // function header { // start of function body using namespace std; // make definitions visible char * t1 = new char; *t1 = 'a'; cout<< "Case 1: " << t1 << "\n"; //Output: a. Valid output char * t2; //*t2 = 'a'; //Can also lead to bus error. Incase it is out of memory assigned to t2 //cout<< "Case 2: " << t2 << "\n"; //Output: a???. Garbled output, since you are trying to store 'a' in neverland //char * t3; //t3 = 'a'; // Compile error: myfirst.cpp:15: error: invalid conversion from 'char' to 'char*' //char * t4; //* t4 = "a"; // Compile er

http://www.ted.com/index.php/talks/lang/eng/jill_bolte_taylor_s_powerful_stroke_of_insight.html

Jill's speech was so impressive. Setting up the mind to share Her experience during a severe hemorrhage is great..the feeling of 'nirvana' is the most inspiring though I am little confused about the experience during such trauma. Buddha and few other persons are known to experience the rare NIRVANA during their lifetime..bt here,JBT experienced that rare happening during hemorrhage..unbelievable and inspiring. http://www.ted.com/index.php/talks/lang/eng/jill_bolte_taylor_s_powerful_stroke_of_insight.html

Hans Rosling: New insights on poverty and life around the world

Hans Rosling: No more boring data: TEDTalks

How to talk to VC (Dos and Donts)

Some sample questions a mentor can ask: If I give you 1 crore how will u invest that in a day Best ans: 30 lakh for myself and my family future and comforts, rest 70 lakh for business. May be I will hire 4-5 best brains to work for me, etc etc. Or how u plan to grow your current business Mentor wants to judge how much are you concerned for your personal comfort, do u have a vision to invest money in your business Most exciting thing you did in college or life It can be academics but also something non academic. How passionate you are to achieve what you want. Something you really wanted to do and you went out of way, went crazy to do it Winning some trophy, Getting gf, some adv trek How ur friends describe you? Friends can judge you best. Some answers can be: visionary, Reliable, strong temperament, enthusiastic, etc Family background Mentor wants to figure out if you have future personal commitment. Most of entrepreneurs drop because of family reasons Why do you want