Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":14063,"date":"2015-05-06T17:28:24","date_gmt":"2015-05-06T22:28:24","guid":{"rendered":"https:\/\/oswaldouliel.withknown.com\/2015\/mastery26---creation-and-use-of-matrixes-in-c"},"modified":"2015-05-06T17:28:24","modified_gmt":"2015-05-06T22:28:24","slug":"mastery26-creation-and-use-of-matrixes-in-c-2","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101winter2015\/2015\/mastery26-creation-and-use-of-matrixes-in-c-2\/","title":{"rendered":"#Mastery26 – Creation and use of matrixes in C++"},"content":{"rendered":"
\n

Creaci\u00f3n y uso de matrices en C++<\/h2>\n

La sintaxis de\u00a0una matriz es C++ es\u00a0la siguiente:<\/p>\n\n\n\n
\n
1<\/div>\n<\/td>\n
\n
\n
int<\/code> matrix[rows][cols];<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

En este ejemplo int es el tipo de dato, matrix es el nombre del todo el conjunto de datos y debo de especificar el numero de filas (rows) y columnas (cols).<\/p>\n

Las matrices tambi\u00e9n pueden ser de distintos tipos de datos como char, float, double, etc. Las matrices en C++ se almacenan al igual que los vectores en posiciones consecutivas de memoria.<\/p>\n

Podriamos imaginarnos que una matriz es como un tablero, pero en realidad\u00a0el manejo es como su definici\u00f3n lo indica, un vector de vectores, es decir, los vectores est\u00e1n uno detr\u00e1s del otro juntos.<\/p>\n

Para acceder a los elementos de la matriz es utilizando su nombre e indicando los 2 sub\u00edndices que van en los corchetes.<\/p>\n

Si coloco int matriz[2][3] = 10; estoy asignando al cuarto elemento de la tercera fila el valor 10.<\/p>\n

Es importante tener en cuenta que tanto filas como columnas se enumeran a partir de 0. Para recorrer una matriz es buena idea hacer uso de un bucle. En este caso usando 2 for:<\/p>\n\n\n\n
\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n<\/td>\n
\n
\n
for<\/code>(<\/code>int<\/code> i = 0; i <\/code><\/div>\n
\u00a0\u00a0<\/code>for<\/code>(<\/code>int<\/code> j = 0; j <\/code><\/div>\n
\u00a0\u00a0\u00a0\u00a0<\/code>matrix[i][j] = i % j;<\/code><\/div>\n
\u00a0\u00a0<\/code>}<\/code><\/div>\n
}<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u00a0<\/p>\n

\u00a0<\/div>\n

Para mas informaci\u00f3n acerca de matrices dinamicas pueden consultar el siguiente enlace:\u00a0<\/a>https:\/<\/wbr>\/<\/wbr>ronnyml.wordpress.com\/<\/wbr>2009\/<\/wbr>07\/<\/wbr>04\/<\/wbr>vectores-matrices-y-punteros-en-c\/<\/wbr><\/a><\/p>\n

\u00a0<\/p>\n

#TC<\/a>1017 #Mastery<\/a>26<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

\n

Creación y uso de matrices en C++<\/h2>\n

La sintaxis de una matriz es C++ es la siguiente:<\/p>\n\n\n\n
\n
1<\/div>\n<\/td>\n
\n
\n
int<\/code> matrix[rows][cols];<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

En este ejemplo int es el tipo de dato, matrix es el nombre del todo el conjunto de datos y debo de especificar el numero de filas (rows) y columnas (cols).<\/p>\n

Las matrices también pueden ser de distintos tipos de datos como char, float, double, etc. Las matrices en C++ se almacenan al igual que los vectores en posiciones consecutivas de memoria.<\/p>\n

Podriamos imaginarnos que una matriz es como un tablero, pero en realidad el manejo es como su definición lo indica, un vector de vectores, es decir, los vectores están uno detrás del otro juntos.<\/p>\n

Para acceder a los elementos de la matriz es utilizando su nombre e indicando los 2 subíndices que van en los corchetes.<\/p>\n

Si coloco int matriz[2][3] = 10; estoy asignando al cuarto elemento de la tercera fila el valor 10.<\/p>\n

Es importante tener en cuenta que tanto filas como columnas se enumeran a partir de 0. Para recorrer una matriz es buena idea hacer uso de un bucle. En este caso usando 2 for:<\/p>\n\n\n\n
\n
2<\/div>\n
3<\/div>\n
4<\/div>\n
5<\/div>\n<\/td>\n
\n
\n
for<\/code>(<\/code>int<\/code> i = 0; i <\/code><\/div>\n
  <\/code>for<\/code>(<\/code>int<\/code> j = 0; j <\/code><\/div>\n
    <\/code>matrix[i][j] = i % j;<\/code><\/div>\n
  <\/code>}<\/code><\/div>\n
}<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

 <\/p>\n

 <\/div>\n

Para mas información acerca de matrices dinamicas pueden consultar el siguiente enlace: <\/a>https:\/\/ronnyml.wordpress.com\/2009\/07\/04\/vectores-matrices-y-punteros-en-c\/<\/a><\/p>\n

 <\/p>\n

#TC<\/a>1017 #Mastery<\/a>26<\/p>\n<\/div>\n

Continue reading →<\/span><\/a><\/p>\n","protected":false},"author":101,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3,26],"tags":[506,166,508,507,243,486,40,287],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts\/14063"}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/users\/101"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/comments?post=14063"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts\/14063\/revisions"}],"predecessor-version":[{"id":14064,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts\/14063\/revisions\/14064"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/media?parent=14063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/categories?post=14063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/tags?post=14063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}