-->

C++ programs examples

------------------------------------------------------------------------------------------------
click the unit you want to know/understand.
--------------------------------------------------------------------------------------

                        It contains basic fundamental of C++ programs. Like, inputs outputs,operators,strings etc.


                                                 It contains programs related to conditions and decisions. Like if program, if..else program,if..else if program,switch program ,break and continue program. 


3. Loop related programs(loop , nested loop):- 
                                       It contains programs using while, or for or do..while loop. It is used to solve complex problem in very say way. We can use any loop to solve any program.


4. Array related programs:-
                                     It contains program using one and multidimensional array. Array is used to use as pointer. It is helpful when we write a program for multiple data using same variable.

5.Array with string programs
                                   If we want to to write program for strings. then either we can use directly string or  we can use array with string.It contains programs related to string processing (with/out library)


6.Function related programs:
                                      We can understand what is function and how to use it. It is helpful to solve complex program in divide and conquer process.It contains programs using user defined function. Click the above link to know more.

7.struct,typedef and union related program : 
                                     This section contains programs using struct, union and typedef . We can be clear about what is struct,union and typedef through examples.

Pointer programs: 
                                 When we write program by using memory directly, then pointer is helpful. It also becomes faster. Here we can get programs related to pointer, array as pointer, pointer as an array, pointer in function, call by value and call by reference. We can also use pointer for strings.

Data file handling related program:
                                      It contains programs using file handling functions etc. If we want our data permanent then we have no option than this.It makes our entered data permanent on hard disk. 

------------------------------------------------------------------------------------------------------------------
Now we are gonna talk about object Oriented program in detail.

1. Object and class program


2.

friends contact management project in c

-----------------------------------------------------------------------
About the project:
          This mini project is about friends contact. It is a mini project developed in C. Here , we can add,view,search and edit contacts of friends.
Here is screen shot of project.



Youtube link: If you want to know more about this click here for youtube video.
                       

to create navigation menu

---------------------------------------------------------------------------
<!DOCTYPE html>
<html>
<head>
<style>
body
{
padding:0;
margin:0;

}
ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: green;
}

li {
  float: left;
}

li a {
  display: block;
  color:white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}

li a:hover {
  background-color: #000;
}
</style>
</head>
<body>

<ul>
  <li><a href="#home">Home</a></li>
  <li><a href="#news">News</a></li>
  <li><a href="#contact">Contact</a></li>
  <li><a href="#about">About</a></li>
</ul>

</body>
</html>

css with html to create layout

<!DOCTYPE html>
<html>
<head>
<style>
.header
{
  column-count: 1;
   
}

.nav
{
column-width:300px;
column-span:2;
float:left;
}
.content
{
column-width:700px;
}
.footer
{
column-count:1;
text-align:center;
color:blue;
}
</style>
</head>
<body>

<div class="newspaper">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.
</div>
<div class="nav">
it is navigation area
</div>
<div class="content">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.
</div>
<div class="footer">
it is footer area.
</div>


</body>
</html>

CSS concept

--------------------------------------------------------------
Let's understand css code with example.

1) css (with html)to create following layout.

   
                                                                                                                                           solution
2) to create following navigation menu
   

                                                                                                                  solution













projects in C

Some simple projects(we can say mini) done in C language using codeblocks IDE are:
------------------------------------------------------------------------------------

click the links

units
1) Friends contact management click to open pdf file
2) Simple English dictionary click to open pdf file
3) application to show inputs and outputs click to open pdf file
4) application to show use of operators click to open pdf file
5) Simple quiz context application click to open its pdf file
6) Library MGMT system click to open pdf file
7)Student record keeping systemclick to open pdf file
simple application with documentation
1.)Simple project on Dog info click for pdf file
want to use these project/code with documentation?
or
you are in need of different projects,
Please contact me at krishnaamallik@gmail.com

program to understand struct pointer using typedef

//understanding struct pointer with typedef
#include <stdio.h>
#include <stdlib.h>
typedef struct reco
{
    int a;
    float b;
    char c;
    char city[100];
}record;
int main()
{
    typedef record *p;//pointer declaration of struct type record
    p pointer;//pointer declartion
    pointer=(p) malloc (sizeof(record));//memory allocation to variable pointer
    pointer->a=10;//value assignment
    pointer->b=3.14;//value assignment
    pointer->c='a';//value assignment
    strcpy(pointer->city,"Kathmandu");//value being copied
    printf("i=%d \nf=%f\nc= %c\n",(*pointer).a,(*pointer).b,(*pointer).c);//value printing
    printf("the city=%s\n",pointer->city);
    free(pointer);
    return 0;
}