C and C++ Programs

C and C++ Programs

It Contains C And C++ programs that are useful for students it includes C programs for data structures

Sorted by: Top Picks
Written by huntgeorge27 on
Passing Structures to Functions Here we can discuss passing structures and their members to functions . Passing Structure Members to Functions When you pass a member of a structure to a function , you are actually passing the value of that member to the function . Therefore, you are passing a simple variable (unless, of course, that element is compound, such as an array ). For example, consider this structure: struct fred { char x; int y; float z; char s[10]; } mike; Here are examples of each member being passed to a function: func(mike.x); /* passes character value of x */ func2(mike.y); /* ... Read Full Story
Written by huntgeorge27 on
Structures A structure is a collection of variables referenced under one name, providing a convenient means of keeping related information together. A structure declaration forms a template that may be used to create structure objects (that is, instances of a structure). The variables that make up the structure are called members. (Structure members are also commonly referred to as elements or fields). Generally, all of the members of a structure are logically related. For example, the name and address information in a mailing list would normally be represented in a structure. The following code fragment shows how to declare a structure that defines the ... Read Full Story
Written by huntgeorge27 on
Structure Assignments The information contained in one structure may be assigned to another structure of the same type using a single assignment statement. That is, you do not need to assign the value of each member separately. The following program illustrates structure assignments: #include int main(void) { struct { int a; int b; } x, y; x.a = 10; y = x; /* assign one structure to another */ printf(”%d”, y.a); return 0; } After the assignment, y.a will contain the value 10. Arrays of Structures Perhaps the most common usage of structures is in arrays of structures. To declare an array of structures, ... Read Full Story
Written by SKumar07 on
I thought the following program was a perfect C program. But on compiling, I found a silly mistake. Can you find it out (without compiling the program :-) ? #include void OS_Solaris_print () { printf ( "Solaris - Sun Microsystems \n " ); } void OS_Windows_print () { printf ( "Windows - Microsoft \n " ); } void OS_HP-UX_print () { printf ( "HP-UX - Hewlett Packard \n " ); } int main () { int num ; printf ( "Enter the number (1-3): \n " ); scanf ( " %d " , & num ); switch ( num ) { case 1 : ... Read Full Story
Written by huntgeorge27 on
Function Arguments If a function is to use arguments, it must declare variables that accept the values of the arguments. These variables are called the formal parameters of the function . They behave like other local variables inside the function and are created upon entry into the function and destroyed upon exit. As shown in the following function , the parameter declarations occur after the function name: /* Return 1 if c is part of string s; 0 otherwise. */ int is_in(char *s, char c) { while(*s) if(*s==c) return 1; else s++; return 0; } The function is_in() has two parameters: s and c ... Read Full Story
I have a file of data that was put into a data file by another program with the same struct. for this program i want to take that data out of the .txt file and put it back into the struct array. is there any big code that is wrong that is popping out? i keep getting a segmentation fault during the...  
From daniweb.com ()
More perspectives...
White paper: The Portland Group - PGI Fortran & C Accelerator Programming ModelComputerWeekly.comThis document describes a collection of compiler directives used to specify regions of code in Fortran and C programs that can be offloaded from a host CPU ...  
From news.google.com ()
More perspectives...
BetaNewsPDC 2009: Scuttling huge chunks of Vista architecture for a faster Windows 7BetaNews"The dispatcher database lock originally protected the integrity of all the scheduler-related data structures," said Kishan. "This includes things like ...and more »  
From news.google.com ()
More perspectives...
Microsoft to open up compilers for Visual Basic and C#Computerworld"Using the same data structures that the compiler users is incredibly useful," Bolognese said. With increased insight into the compilers, developers could, ...and more »  
From news.google.com ()
More perspectives...
Crunchbase Data Mashed Into Microsoft PivotSYS-CON Media (press release)Most JSON objects will have nested data structures. When that happens, you will need to have a new data type that you create with the same name of the data ...  
From news.google.com ()
More perspectives...
Beta 2 Brings Refinements to .NET's Coordination Data Structures LibraryInfoQ.comCoordination Data Structures (CDS) is designed both to be used directly and to act as the building blocks for more complex concurrency frameworks. ...  
From news.google.com ()
More perspectives...
Windows 7: Burning Simplicity to Save the OSTechNewsWorld"The dispatcher database lock originally protected the integrity of all the scheduler-related data structures," said Kishan. "This includes things like ...and more »  
From news.google.com ()
More perspectives...
Sponsors
Sorted by: Top Rated
Click to play video
Sorted by: Top Rated
No pictures yet.
Sorted by: Top Rated
No entries yet.
More From Zimbio
Copyright © 2009 - Zimbio, Inc. Some rights reserved.