Saturday, November 13, 2010

How to display the message box through Command Prompt



How to display the message box through Command Prompt

Procedure:

Step 1: Go to “Start” Menu and Click Run option.
Step 2: Enter “cmd” in drop down box.

Step 3: In CMD window, Type as “msg Console [User Content]”.

Ex: msg console Enjoy life with new technology!!!

OUTPUT:
 

Monday, November 1, 2010

How to find the variable size without using Sizeof function

/*
 * sizeofVariable.c
 * Author : karthikeyan.D
 * Date: 1-Nov-2010
 *
 */
/* please refer this following statements.
#ifndef __SIZE_T
#define __SIZE_T
typedef unsigned int size_t;
#endif
.... meaning that on this particular implementation `size_t' is
an `unsigned int'.

*/


# include <stdio.h>
# include <stdlib.h>
//user definition
# define size_var( var ) ((size_t)(&(var)+1)-(size_t)(&(var)))

int main()
{
    int nVal;
    char cChar;
    printf("size of :%d\n",size_var(nVal));
    printf("size of :%d",size_var(cChar));
    return 0;
}