Thursday, September 25, 2014

Classes defined with struct and union in C++

When it comes to C++ everything is pushed beyond limits, and so it the case of a class defined with struct or union keyword. But the point I would like to share with you on this post is the key difference involved.
            The concepts of class and data structure are so similar that both keywords (struct and class) can be used in C++ to declare classes (i.e. structs can also have function members in C++, not only data members). The only difference between both is that members of classes declared with the keyword struct have public access by default, while members of classes declared with the keyword class have private access. For all other purposes both keywords are equivalent.
    In a similar fashion, the concept of unions is different from that of classes declared with struct and class, since unions only store one data member at a time, but nevertheless they are also classes and can thus also hold function members. The default access in union classes is public.
Credit : Juan Soulie

Wednesday, September 24, 2014

Difference between an array and dymanic memory pointer in C++

It is known to all that the least thing any programmer would like to deal with is dealing with Pointers. May Java be blessed !
Suppose I have two declarations:

1)  int array[10] //an array of 10 integer elements

2) int  *pArray ;
    pArray = new int [10];

The major difference is that for the normal array (1) , the size of the array is constant and has to be decided before the execution. However the dynamic memory allocation (2) give you more flexibity by allowing you to assign memory during the execution of the program (runtime) using any variable or constant value as its size.

 How to access elements from our declaration:
  array[2] // accessing the third element
  pArray[2] or  *(pArray+2)  // accessing the third element ....

Tuesday, April 8, 2014

How to turn on or off IIS on windows 7 or windows 8 ?

note: IIS stands for Internet Information Services...
Sometimes troubleshooting some issues with ports or others may require that you make sure your IIS is down or up as it is using by default the port 80. Even though there are many ways to do this I found this one particularly easier and decided to share it with you.

1. Simultaneously press Win + R keys and the Run dialog window pop up
           or
 type run in the lower bottom left textfield (prompting Search programs and files) under All Programs


2.  type: appwiz.cpl and Click OK

  
3. On the top left: click on Turn Windows features on or off
  
4.  Then finally you are there . Most obviously the second branch below Games will be Internet Information Services. You can turn it on or off by just filling or clearing the box...

You are now free to proceed accordingly depending of what you want to do. Stay blessed!


#1045 - Access denied for user 'root'@'localhost' (using password: NO) Solved

Here come another crazy issue intended to waste our time uselessly.
After changing the root password from the phpMyAdmin under Privileges I started getting this disgusting error page. Definitely you may suspect your mysql config or apache config file. Unfortunately the problem reside elsewhere as you are going to see.

solution:

Goto--->xampp--->phpMyAdmin folder:
Here open the file: config.inc.php
and edit as follows from around line 18 to 22 :





Change it to:
Refresh it and You are done !

Apache (xampp) not starting on windows 7

Hi, I just pass another dirty 30 minutes trying to sort out this issue. Without this nonsense of Microsoft stopping the support of XP,  I would have never been there even .
 I installed a new version of windows 7 and also installed a latest version of xampp successfully. When I start apache later it couldn't start. Usually this problem is often caused by the port 80 being busy because of Skype, IIS, etc. However I don't have skype installed on my PC yet, even IIS is not running , I even when further in the CMD listing port with > netstat -aon  still no mention of port 80.
 I started realizing that I am dumped this time again my dear Microsoft black box OS (smile).

Solution:

I finally get it started by right clicking the Xampp Control Panel icon on the desktop and  
Run as administrator and boooooommmmmmmm it just fires like a charm. This may not be a standard solution but help you work around. We never make it till some times we fake it. That said stay tuned and don't forget to drop a comment....