Tag Archives: #Mastery07

Learn To Program 2015-02-16 23:14:00

MASTERY07
Los comentarios en un lenguaje de programación no tienen ningún efecto en la compilación del programa. Simplemente funcionan como anotaciones legibles para el programador escritas en el código fuente que ayudan a entender secciones de código, proporcionan información adicional o mejoran la limpieza de un programa.
**********************
Programa hecho en Python:
**********************
https://gist.githubusercontent.com/A01630323/a7555019f5ebad107b80/raw/a0d30fcae5c6a0c70a6ff2b981672091cad30f6d/Mastery07

Comments

Comments are a very useful tool on programming, you can add stuff to your source code, this can be for you to understand better what you did in a certain spot of the code, maybe a remainder of something that needs to be done, or even for academic purposes by adding a comments for better teaching of the code.

The compiler ignores the comments, that means you can type in anything you like.

COMMENTS

DIEGO PLASCENCIA A01229988

COMMENTS ARE USED TO EXPLAIN YOURSELF OR TO REMEMBER THINGS OF YOUR PROGRAM. THERE ARE MANY WAYS TO COMMENT ON C++

(YOU USE “/*” TO START THE COMMENT AND “*/” TO FINISH IT, THIS IS USED NORMALY FOR BIG COMMENTS. EXAMPLES:

/* COMMENT */

/* A

   VERY

    BIG

    COMMENT*/

IF YOU WILL WRITE A SMALL COMMENT YOU CAN SIMPLY USE DOUBLE “/”. EXAMPLE:

// COMMENT.

HERE IS A GREAT LINK THAT COULD HELP YOU TO UNDERSTAND BETTER THE COMMENTS.

http://www.tutorialspoint.com/cplusplus/cpp_comments.htm

 

Use of comments in C++

Hello , this is

Use of comments in C++

Photo Credit: Graffyc Foto via Compfight cc

 

Comments in C++ are normally used to annotate code for future reference. The compiler treats them as white space. You can use comments in testing to make certain lines of code inactive.

To do that, there are two ways to comment in C++. You can use “/*” (slash, asterisk) to comment everything, including new lines; to make the end of everything that you wanna comment it must ends with “*/”. For Example:

<iostream>

using namespace std;

int main() {

   cout << "hello world" << endl;

   /*This is the text that

   I wanna

   comment*/

   return 0;

}

 

Another way to comment is with “//” (two slashes). If you put double slash you’ll comment on your code only the single line. Example:

<iostream>

using namespace std;

int main(){

   cout << "hello world" << endl; //This is a comment

   This is not a comment

   return 0;

}

 

In this page you can find more infor about this topic.

 

Hey gusy here is my Mastery07

Check my new video where you can learn about python!

Here is the link of my Mastery07: http://youtu.be/BuRgfdvwD7c

 

Mastery 07

Hi everybody. Here´s a video of me expalining the two types of comments in C++. I hope it is useful. 

https://www.youtube.com/watch?v=aNCDLvuQ7oI&feature=youtu.be&hd=1

 

Here´s the information in case you don´t feel like watching the video.

One way of making commments in c++ is by using two slashes and the write your comment //just a comment

The other one looks like this /*just a comment*/ You have to open and close your comment whit one slash and an asterisk.

luisgarcia11 2015-02-11 21:58:24

link to the video where I explain the use of comments https://www.youtube.com/watch?v=ELpI66c6rOY&feature=youtu.be

MASTERY 07

USE OF COMMENTS IN PYTHON:

MASTERY 07

In the previous screenshot I made a simple explanation of the uses of comments in python it’s really useful and helpful if you have to do a long program and you don’t remember something then with the comments just using this symbol “#” you can do the comment and remember one or many important things. xoxo

MASTERY 07

MASTERY07

To do coments in C++ programming, you just need to put this signs:

// the coment  

In the picture the coment is //funwithnumbers

use of comments in Python

The comments are lines of text but they are ignored by compilers and interpreters, so the user or another person can see the comments, they are very helpful for make eassir the undertand the programs.

here is a video that show how to use comments in python: https://www.youtube.com/watch?v=dXDb2BOa8II