Conteúdo do Curso
C++ Templates
C++ Templates
Creating Your First Template
Creating a template is actually quite simple, and it's one of the easiest parts of using them. To start, you'll need to create either a function or a class. We will start with the function.
main
void MyFirstTemplate() { } int main() { MyFirstTemplate(); }
As you can see, there is a very simple function that does nothing for now. We can easily call it inside the main function. Your task now is to turn it into a template.
Tarefa
- Follow the comments and turn the function into a template.
Once you've completed this task, click the button below the code to check your solution.
Tarefa
- Follow the comments and turn the function into a template.
Once you've completed this task, click the button below the code to check your solution.
Tudo estava claro?
Creating Your First Template
Creating a template is actually quite simple, and it's one of the easiest parts of using them. To start, you'll need to create either a function or a class. We will start with the function.
main
void MyFirstTemplate() { } int main() { MyFirstTemplate(); }
As you can see, there is a very simple function that does nothing for now. We can easily call it inside the main function. Your task now is to turn it into a template.
Tarefa
- Follow the comments and turn the function into a template.
Once you've completed this task, click the button below the code to check your solution.
Tarefa
- Follow the comments and turn the function into a template.
Once you've completed this task, click the button below the code to check your solution.
Tudo estava claro?
Creating Your First Template
Creating a template is actually quite simple, and it's one of the easiest parts of using them. To start, you'll need to create either a function or a class. We will start with the function.
main
void MyFirstTemplate() { } int main() { MyFirstTemplate(); }
As you can see, there is a very simple function that does nothing for now. We can easily call it inside the main function. Your task now is to turn it into a template.
Tarefa
- Follow the comments and turn the function into a template.
Once you've completed this task, click the button below the code to check your solution.
Tarefa
- Follow the comments and turn the function into a template.
Once you've completed this task, click the button below the code to check your solution.
Tudo estava claro?
Creating a template is actually quite simple, and it's one of the easiest parts of using them. To start, you'll need to create either a function or a class. We will start with the function.
main
void MyFirstTemplate() { } int main() { MyFirstTemplate(); }
As you can see, there is a very simple function that does nothing for now. We can easily call it inside the main function. Your task now is to turn it into a template.
Tarefa
- Follow the comments and turn the function into a template.
Once you've completed this task, click the button below the code to check your solution.