Sunday, February 14, 2016

Prolog Programming- DOSBOX turbo prolog : how to run

If you are looking for where to start prolog programming, this article may help you.

At the very beginning you may proceed from DosBox. You may heard about a compiler SWI prolog for prolog programming. Well, But starting from the DosBox will be great!

Step 1: Install DosBox from here:
http://www.dosbox.com/download.php?main=1
install it.
Step 2: Now download and copy-paste this file into your C drive.
prolog

Step 3: Open DosBox.

Write-  mount c c:\prolog
then enter.




C programming- The Pointer (basic)

When talking about pointer, Pointer is one of the most important topic of C programming language.
There is many use of pointer in programming. But this article focus only the basic of the pointer in C programming language.

This article is for those:
1. Who wants to know the basics of Pointer in c language.
2.Who are looking to understand pointer with examples.


Pointer is a variable. Pointer holds memory address. Whose memory address?
Pointer holds the memory address of an object.

How to declare:

data type *variable_name;

like, int *p
        float *q;

there are two pointer operators: 1. & and 2. *

&: It means the address of the variable.
* : It means the value of the address.

An example can explain the basics of these two operators:

#include <stdio.h>
int main()
{
    int *x,v;

    v = 10; /* variable v is given a value 10 */
    x = &v; /* x is point to the address of v */

    /* as address of v has value of 10 */
    /* So v returns 10 */

    printf ("%d", *x);

    return 0;
}

Here we can see that, & operator holds the memory address.
* operator points to the value of that memory address.