Halloween Costume ideas 2015

Nanci Santisteban

Úlitmos Posts

Un prototipo de función en C ofrece información importante para el compilador

Para entender mejor este concepto he creído necesario hacernos las siguientes interrogaciones:

A que se dedica el prototipo de función en C?
Un prototipo de función en C pasa información importante para el compilador.

Que tipo de información ofrece el prototipo de función en C al compilador?
Las principales informaciones que ofrece el prototipo de función en C son el tipo de dato que retorna la función, el número, el tipo y el orden de parámetros que recibe la misma.

Para qué utiliza el compilador a los prototipos?
El compilador utiliza a los prototipos para verificar las llamadas a funciones. Antiguamente no existía el prototipado por lo cual muchas veces se generaban errores de todo tipo en el uso del lenguaje. Esto será detallado más adelante.

Hagamos un ejemplo de Prototipo de funcion en C:
int maximo(int, int, int);

Este ejemplo de prototipo o declaración de funcion en C indica 2 cosas importantes que el compilador debe llevar en cuenta:
  1. Que la función de nombre "maximo" va a retornar como resultado un valor de tipo entero ("int"). 
  2. Que la función de nombre "maximo" debe ser llamada con tres parámetros del tipo entero ("int").
 Otro importante beneficio de los prototipos o declaraciones de funciones en C:
El prototipo o declaración de funciones en C tambien sirve para la "coerción de argumentos", osea si la función es llamada con valores de otro tipo que sean diferentes a los definidos en el prototipo de esa función, el compilador "intentará" convertir esos valores a los tipos de datos correspondientes declarados en el prototipo (esto siempre y cuando sea posible esa conversión entre esos tipos de datos.). Por ejemplo si la función espera un entero y recibe un decimal, esta intentará convertir ese decimal a entero truncando la parte decimal, lo cual puede generar errores si la exactitud de ese dato es importante. Por esta razón es importante tomar en cuenta el tema de la "Coerción de argumentos", la cual puede estar en modo automático y acabar perjudicando el desenvolvimiento del proyecto.

Nota: Cabe resaltar que el prototipado o declaración de funciones en C puede omitirse cuando se está programando; con esta omisión el compilador formará el prototipo o declaración dependiendo de la primera aparición de la función.
En el ejemplo en caso de omisión del prototipado el compilador asumirá que toda función regresa un valor del tipo entero de forma predeterminada.


Uno de los aprimoramientos de C++ en relación al lenguaje C es la construcción "class".

Básicamente debemos saber que una clase define la forma de un objeto.

Las características principales de la construcción "class" son:
  • define nuevos tipos de datos que especifican la forma de un objeto.
  • incluye datos y código que operaran sobre esos datos.
  • combina miembros de datos y funciones de miembros en una única unidad.
Conceptos básicos a tomar en cuenta:
  1. Miembros de clase: es el código y los datos que constituyen una clase.
  2. Variables de miembros o Variables de instancia: son los datos definidos por la clase
  3. Funciones miembro: son el código que opera en los datos definidos por la clase.
  4. Objetos: son instancias de una clase.
Podemos postar un primer ejemplo, el cual define un tipo llamado CRender, el cual es usado para implementar operaciones de renderizado en este caso, veamos: 

// Esto define la clase CRender
class CRender {
char buffer[256];
public:
void m_Renderizar();
};

Viendo más de cerca esta declaración de la clase, podemos notar que todos los miembros de CRender son declarados dentro de la declaración "class". Las variables miembro de CRender es buffer y la función miembro es m_Renderizar. Tal como se muestra en la siguiente figura:
Variables Miembro y la Función Miembro.

Nota Importante: Por defecto los miembros de una clase son privados; esto significa que sólo pueden acceder a ella otros miembros de la misma clase y ninguna otra parte del programa, en el caso del ejemplo la variable buffer es privada, eso quiere decir que sólo habra acceso a esta variable para los miembros de la clase CRender. Todo esto hace que sea posible la Encapsulación. Osea podemos controlar el acceso a ciertos elementos de datos manteniéndolos privados. 


Ahora si usted quiere hacer pública una parte de la clase (osea accesible a otras partes del programa), pues entonces usted debe declarar esta con la palabra clave public, así todas las variables o funciones definidas después de la palabra clave public seran accesibles por todas las demás funciones en el programa. En el ejemplo puede notarse que la función m_Renderizar() es pública. Tal como se muestra en la figura.


Notemos que la palabra clave "public" es seguida con ":", que no se le olvide.
Tampoco olvidemos que un objeto forma una relación entre código y datos.

Una función miembro tiene acceso a los elementos privados de su clase, esto quiere decir que m_Renderizar tiene acceso a buffer en nuestro ejemplo.

Si usted quiere añadir una función miembro a la clase, se debe especificar su prototipo en la definición de la misma.



Por lo tanto podemos concluir de que una clase es esencialmente un conjunto de planos que especifican como construir un objeto.

C++ hoy es utilizado en muchos softwares distribuidos en grandes empresas.
Un ordenador hoy en día se ha convertido en un elemento esencial de nuestra sociedad moderna. El trabajo en fábricas, establecimientos de ventas, laboratorios de investigación y desarrollo, etc; estan todos siendo controlados por computadoras. Y no sólo eso, la mayor parte de nuestro futuro está estrechamente vinculado con la evolución de los sistemas informáticos lo cual implica un desarrollo del hardware y tambien del software. Esto se refleja claramente en el rápido desarrollo de equipos informáticos que vemos hoy en día. Súper computadores que son capaces de procesar miles de millones de instrucciones por segundo es la novedad de hoy en día. Los computadores portátiles hoy en día tienen mejores velocidades y precios menores que aquellos fabricados una década antes. Pero queda claro que solo las máquinas no son suficientes, tambien se necesita de un software robusto y eficiente para hacer que estas máquinas se ejecuten en toda su extensión y los lenguajes de programación son la base para un software eficiente.



Un hardware típico de computador consiste en uno o más chips de microprocesadores conectados a los chips de apoyo y otros circuitos electrónicos. Estos chips incluyen chips de memoria caché y primaria generalmente llamada de memoria RAM (memoria de acceso aleatorio). Además, el microprocesador está también conectado a los dispositivos de almacenamiento de memoria, como disquete, CD-ROM (disco compacto de memória de solo lectura), discos duros, etc.






El chip microprocesador que es el chip principal también se denomina CPU (Central Processing Unit ó Unidad de procesamiento central). Su estructura interna consta de circuitos que forman el número de registros (el número típico es 16), una unidad aritmética, una unidad lógica y una unidad de control, este tiene gran número de terminales para la conexión de dispositivos externos (por ejemplo, una CPU típica tiene hasta 478 terminales). De estos el grupo de terminales es para datos de entrada y datos de salida, otro de los grupos es para las direcciones de memoria y aún el otro grupo es para fines de control. Cabe mencionar también que, varios terminales son para el servicio de interrupción. Una interrupción es como estrellarse contra la puerta. Supongamos que un programa se está ejecutando en el ordenador y se le interrumpe para que comience nuestro programa. Primero el ordenador guarda el estado del programa en curso, emprende el nuevo curso y al finalizar el trabajo en él, se reanuda el programa que estaba en curso. Cada CPU soporta un conjunto de instrucciones diseñadas por el fabricante. No debemos entrar en detalle de la circuitería compleja, sin embargo, algunos de los nombres mencionados anteriormente se utilizan a menudo en programación de software y un estudiante debe estar familiarizado con ellos.
      

Quiero hacer mención antes que nada que C++ es un lenguaje de programación excelente en cuanto al procedimiento, tanto como para la programación orientada a objetos y algo muy importante es que da apoyo a las más diversas aplicaciones en comparación con cualquier otra lenguaje de programación de computadores.
'Sabías que esta es una de las razones por las que C++ es utilizado ahora en más del 80% de todos los softwares que son creados en la actualidad?'
Pues sí mis amigos, el que C++ sea el apoyo de muchos desarrolladores para crear software de renombre, hace que aquellas personas de buen conocimiento en este lenguaje tengan un excelente acceso a muchas oportunidades de empleo. Sin embargo muchos estudiantes de este lenguaje de programación concluyen que programar con C++ es una tarea difícil.
Pues bien, aquí en este site usted va a sumergirse en un mundo fascinante, ya que presentamos el tema teniendo en cuenta esas dificultades que todo alumno tiene y por eso vamos paso a paso colocando en cada tópico muchos ejemplos ilustrativos, de modo que los lectores puedan facilmente comprender el contenido. La programación se aprende mucho más rápido con programas desarrollados en vivo y no leyendo un montón de libros que enseñan como programar.

STL: La librería de software para el lenguaje C++.
Cabe señalar tambien que este site explica con extensa cobertura el STL (Standard Template Library ó en español Bibliotecas de modelos standard) que es una librería de software para el lenguaje de programación C++. A la vez señalamos que en este site se menciona tambien la programación de procedimiento, la cual nos prepara para conocer mejor los tópicos más complejos manejados en el lenguaje, tales como clases, sobrecarga de operadores, herencia, programación orientada a objetos (POO), funciones de modelos y clases, sets, multisets, maps, multimaps, stacks, queues, etc. Todo esto tratado en detalle. Todo el contenido de este site ya fué testado y pueden quedarse seguros de que todo esto funciona al 100%. Bueno sin más preámbulo les invito a entrar a cada capítulo. Buena suerte en su estudio, hagan sus comentarios los cuales son de ayuda en todo momento para la mejora de este y otros contenidos.

Bien mis queridos lectores, es hora de comenzar, lean y practiquen. El lenguaje C++ es fácil para quien lo practica a cada momento de su vida!

    Whats in your bag, PR Girl
    Slowly she drifted to the southeast, rising higher and higher as the flames ate away her wooden parts and diminished the weight upon her. Ascending to the roof of the building I watched her for hours, until finally she was lost in the dim vistas of the distance. The sight was awe-inspiring in the extreme as one contemplated this mighty floating funeral pyre, drifting unguided and unmanned through the lonely wastes of the Martian heavens; a derelict of death and destruction, typifying the life story of these strange and ferocious creatures into whose unfriendly hands fate had carried it.

    Much depressed, and, to me, unaccountably so, I slowly descended to the street. The scene I had witnessed seemed to mark the defeat and annihilation of the forces of a kindred people, rather than the routing by our green warriors of a horde of similar, though unfriendly, creatures. I could not fathom the seeming hallucination, nor could I free myself from it; but somewhere in the innermost recesses of my soul I felt a strange yearning toward these unknown foemen, and a mighty hope surged through me that the fleet would return and demand a reckoning from the green warriors who had so ruthlessly and wantonly attacked it.

    Close at my heel, in his now accustomed place, followed Woola, the hound, and as I emerged upon the street Sola rushed up to me as though I had been the object of some search on her part. The cavalcade was returning to the plaza, the homeward march having been given up for that day; nor, in fact, was it recommenced for more than a week, owing to the fear of a return attack by the air craft.

    Lorquas Ptomel was too astute an old warrior to be caught upon the open plains with a caravan of chariots and children, and so we remained at the deserted city until the danger seemed passed.

    As Sola and I entered the plaza a sight met my eyes which filled my whole being with a great surge of mingled hope, fear, exultation, and depression, and yet most dominant was a subtle sense of relief and happiness; for just as we neared the throng of Martians I caught a glimpse of the prisoner from the battle craft who was being roughly dragged into a nearby building by a couple of green Martian females.

    And the sight which met my eyes was that of a slender, girlish figure, similar in every detail to the earthly women of my past life. She did not see me at first, but just as she was disappearing through the portal of the building which was to be her prison she turned, and her eyes met mine. Her face was oval and beautiful in the extreme, her every feature was finely chiseled and exquisite, her eyes large and lustrous and her head surmounted by a mass of coal black, waving hair, caught loosely into a strange yet becoming coiffure. Her skin was of a light reddish copper color, against which the crimson glow of her cheeks and the ruby of her beautifully molded lips shone with a strangely enhancing effect.

    She was as destitute of clothes as the green Martians who accompanied her; indeed, save for her highly wrought ornaments she was entirely naked, nor could any apparel have enhanced the beauty of her perfect and symmetrical figure.

    As her gaze rested on me her eyes opened wide in astonishment, and she made a little sign with her free hand; a sign which I did not, of course, understand. Just a moment we gazed upon each other, and then the look of hope and renewed courage which had glorified her face as she discovered me, faded into one of utter dejection, mingled with loathing and contempt. I realized I had not answered her signal, and ignorant as I was of Martian customs, I intuitively felt that she had made an appeal for succor and protection which my unfortunate ignorance had prevented me from answering. And then she was dragged out of my sight into the depths of the deserted edifice.

    As I came back to myself I glanced at Sola, who had witnessed this encounter and I was surprised to note a strange expression upon her usually expressionless countenance. What her thoughts were I did not know, for as yet I had learned but little of the Martian tongue; enough only to suffice for my daily needs.

    As I reached the doorway of our building a strange surprise awaited me. A warrior approached bearing the arms, ornaments, and full accouterments of his kind. These he presented to me with a few unintelligible words, and a bearing at once respectful and menacing.[full-post]

    fashionWeddingInteriorflowerother fashioncars
    This midnight-spout had almost grown a forgotten thing, when, some days after, lo! at the same silent hour, it was again announced: again it was descried by all; but upon making sail to overtake it, once more it disappeared as if it had never been. And so it served us night after night, till no one heeded it but to wonder at it. Mysteriously jetted into the clear moonlight, or starlight, as the case might be; disappearing again for one whole day, or two days, or three; and somehow seeming at every distinct repetition to be advancing still further and further in our van, this solitary jet seemed for ever alluring us on.

    Nor with the immemorial superstition of their race, and in accordance with the preternaturalness, as it seemed, which in many things invested the Pequod, were there wanting some of the seamen who swore that whenever and wherever descried; at however remote times, or in however far apart latitudes and longitudes, that unnearable spout was cast by one self-same whale; and that whale, Moby Dick. For a time, there reigned, too, a sense of peculiar dread at this flitting apparition, as if it were treacherously beckoning us on and on, in order that the monster might turn round upon us, and rend us at last in the remotest and most savage seas.

    These temporary apprehensions, so vague but so awful, derived a wondrous potency from the contrasting serenity of the weather, in which, beneath all its blue blandness, some thought there lurked a devilish charm, as for days and days we voyaged along, through seas so wearily, lonesomely mild, that all space, in repugnance to our vengeful errand, seemed vacating itself of life before our urn-like prow.

    But, at last, when turning to the eastward, the Cape winds began howling around us, and we rose and fell upon the long, troubled seas that are there; when the ivory-tusked Pequod sharply bowed to the blast, and gored the dark waves in her madness, till, like showers of silver chips, the foam-flakes flew over her bulwarks; then all this desolate vacuity of life went away, but gave place to sights more dismal than before.

    Close to our bows, strange forms in the water darted hither and thither before us; while thick in our rear flew the inscrutable sea-ravens. And every morning, perched on our stays, rows of these birds were seen; and spite of our hootings, for a long time obstinately clung to the hemp, as though they deemed our ship some drifting, uninhabited craft; a thing appointed to desolation, and therefore fit roosting-place for their homeless selves. And heaved and heaved, still unrestingly heaved the black sea, as if its vast tides were a conscience; and the great mundane soul were in anguish and remorse for the long sin and suffering it had bred.

    Cape of Good Hope, do they call ye? Rather Cape Tormentoto, as called of yore; for long allured by the perfidious silences that before had attended us, we found ourselves launched into this tormented sea, where guilty beings transformed into those fowls and these fish, seemed condemned to swim on everlastingly without any haven in store, or beat that black air without any horizon. But calm, snow-white, and unvarying; still directing its fountain of feathers to the sky; still beckoning us on from before, the solitary jet would at times be descried.

    During all this blackness of the elements, Ahab, though assuming for the time the almost continual command of the drenched and dangerous deck, manifested the gloomiest reserve; and more seldom than ever addressed his mates. In tempestuous times like these, after everything above and aloft has been secured, nothing more can be done but passively to await the issue of the gale. Then Captain and crew become practical fatalists. So, with his ivory leg inserted into its accustomed hole, and with one hand firmly grasping a shroud, Ahab for hours and hours would stand gazing dead to windward, while an occasional squall of sleet or snow would all but congeal his very eyelashes together. Meantime, the crew driven from the forward part of the ship by the perilous seas that burstingly broke over its bows, stood in a line along the bulwarks in the waist; and the better to guard against the leaping waves, each man had slipped himself into a sort of bowline secured to the rail, in which he swung as in a loosened belt. Few or no words were spoken; and the silent ship, as if manned by painted sailors in wax, day after day tore on through all the swift madness and gladness of the demoniac waves. By night the same muteness of humanity before the shrieks of the ocean prevailed; still in silence the men swung in the bowlines; still wordless Ahab stood up to the blast. Even when wearied nature seemed demanding repose he would not seek that repose in his hammock. Never could Starbuck forget the old man's aspect, when one night going down into the cabin to mark how the barometer stood, he saw him with closed eyes sitting straight in his floor-screwed chair; the rain and half-melted sleet of the storm from which he had some time before emerged, still slowly dripping from the unremoved hat and coat. On the table beside him lay unrolled one of those charts of tides and currents which have previously been spoken of. His lantern swung from his tightly clenched hand. Though the body was erect, the head was thrown back so that the closed eyes were pointed towards the needle of the tell-tale that swung from a beam in the ceiling.* [right-side]


    "In spite of all these diseases, and of all the new ones that continued to arise, there were more and more men in the world. This was because it was easy to get food. The easier it was to get food, the more men there were; the more men there were, the more thickly were they packed together on the earth; and the more thickly they were packed, the more new kinds of germs became diseases. There were warnings. Soldervetzsky, as early as 1929, told the bacteriologists that they had no guaranty against some new disease, a thousand times more deadly than any they knew, arising and killing by the hundreds of millions and even by the billion. You see, the micro-organic world remained a mystery to the end. They knew there was such a world, and that from time to time armies of new germs emerged from it to kill men.

    "And that was all they knew about it. For all they knew, in that invisible micro-organic world there might be as many different kinds of germs as there are grains of sand on this beach. And also, in that same invisible world it might well be that new kinds of germs came to be. It might be there that life originated—the 'abysmal fecundity,' Soldervetzsky called it, applying the words of other men who had written before him...."

    It was at this point that Hare-Lip rose to his feet, an expression of huge contempt on his face.
    "Granser," he announced, "you make me sick with your gabble. Why don't you tell about the Red Death? If you ain't going to, say so, an' we'll start back for camp."

    The old man looked at him and silently began to cry. The weak tears of age rolled down his cheeks and all the feebleness of his eighty-seven years showed in his grief-stricken countenance.

    "Sit down," Edwin counselled soothingly. "Granser's all right. He's just gettin' to the Scarlet Death, ain't you, Granser? He's just goin' to tell us about it right now. Sit down, Hare-Lip. Go ahead, Granser."

    The old man wiped the tears away on his grimy knuckles and took up the tale in a tremulous, piping voice that soon strengthened as he got the swing of the narrative.

    "It was in the summer of 2013 that the Plague came. I was twenty-seven years old, and well do I remember it. Wireless despatches—"
    Hare-Lip spat loudly his disgust, and Granser hastened to make amends.

    "We talked through the air in those days, thousands and thousands of miles. And the word came of a strange disease that had broken out in New York. There were seventeen millions of people living then in that noblest city of America. Nobody thought anything about the news. It was only a small thing. There had been only a few deaths. It seemed, though, that they had died very quickly, and that one of the first signs of the disease was the turning red of the face and all the body. Within twenty-four hours came the report of the first case in Chicago. And on the same day, it was made public that London, the greatest city in the world, next to Chicago, had been secretly fighting the plague for two weeks and censoring the news despatches—that is, not permitting the word to go forth to the rest of the world that London had the plague. [left-side]

    Nanci Santisteban

    Formulario de contacto

    Nome

    E-mail *

    Mensagem *

    Tecnologia do Blogger.
    Javascript DisablePlease Enable Javascript To See All Widget