Ejemplosde.com Home | Contact
Lots of Examples The first webpage of examples. memorandums, letters, formats, help for your job or schoolwork. Lots of Examples


ExampleOf.NET Navigation Most Popular ExampleOf.NET Navigation
 Example of Troublesome Verb Pairs
 Example of A Special Invitation to Books
 Example of Active and Passive Voice
 Example of Irregular Verbs
 Example of Adjectives
 Example of Tenses of Verbs
 Example of Avoiding Errors with Tense
 Example of Capitalization
 Example of Progressive Forms of Verbs
 Example of Verbs
 Example of Grammar and Writing Workshop

ExampleOf.NET Navigation Newest ExampleOf.NET Navigation
 Example of Return Button in PHP
 Example of Grammar and Writing Workshop
 Example of A Special Invitation to Books
 Example of Capitalization
 Example of Tenses of Verbs
 Example of Forms of be, have, and do
 Example of Irregular Verbs
 Example of Progressive Forms of Verbs
 Example of Active and Passive Voice
 Example of Troublesome Verb Pairs
 Example of Avoiding Errors with Tense
 Example of Multiple Source files
 Example of Verbs
 Example of Hello World in C++
 Example of Hello World in PHP
 Example of Adjectives



ExampleOf.NET Navigation Navigation: ExampleOf.NET Navigation
 C/C++ (2)
 English (12)
 PHP (2)

Home > C/C++ > Example of Multiple Source files (Viewed 4534 times)

Example of Multiple Source files:

Here's an example on how to create multiple source files in C++

main.cpp

#include <iostream>

using namespace std;

int square(int numero);
int cube(int numero);
void sleep(unsigned int mseconds);

int main()
{

    for(int counter = 1; counter<=10; counter++) {
        cout << "Square of a" << counter << ": " << square(counter) << endl;
        sleep(1000);
    }
    for(int counter = 1; counter<=10; counter++) {
        cout << "Cube of a" << counter << ":" << cube(counter) << endl;
        sleep(1000);
    }
    return 0;
}

functions.cpp

#include <time.h>

void sleep(unsigned int mseconds)
{
    clock_t goal = mseconds + clock();
    while (goal > clock());
}

int square(int numero) {
    return numero * numero;
}

int cube(int numero) {
    return numero * numero * numero;
}

 


Keywords: Example of Multiple Source files, Multiple Source files, counter, numero, sleep,
Date: 17-11-2017 20:42:51 Author: Luffy Views: 4534

Check out some related examples...

Example of Hello World in C++
Example of Multiple Source files

References

Multiple Source files
Evaluacion Multiple Choice - Browse Files at SourceForge.net

0 comments in Example of Multiple Source files

No comments.

Write a comment in Example of Multiple Source files

Name:(*)
Web:
Email:(*) (it won't be published)
Captcha
Comment:(*)  
Your comment won't be published inmediately. Your comment will be revised by the administrators of the site.
© 2017 www.exampleof.net Sitemap