Thursday, March 14, 2024

m

 The MVC or separete logic from presentation. is a well knowned paradigm.


 Its knowned that MVC Frameworks implemented the Model View Controller.


In MVC we have a

-> model -> view -> Controlelr.

  • Model - That is called afther the user imput in the controller
  • View - The interface
  • Controller - Controles user commands



This is created in the year 1970 to be able to reclicle code. Lather i think the paradigm evolve because of mainting code. Is not just to recicle but to make updates.

In separte logic from settings we can have a similar effect of code efficiency. Wid out using objects. Which are kind of heavy on the system since they antangle a lot of information.


Function update_interface (interface var1 var2 var3 int1 )

{


}


Global interface 

Global var1 

Global var2 

Global var3 

Global int1 

Function update_interface ( )

{

access interface

access var1 

access var2 

access var3

access int1  

}



This way you can change your setting the way you want width out the need to change functions.


These is achieved width objects but these have limitations. First these variables are inside objectes which you need high amount of knowledge to access them. These way the variables are acessible for any one and objects become more modular.

Wednesday, March 6, 2024

Simple two file graphics library for C/C++

 

[b]Found this two files graphics[/b], not bad graphics for 2 files. It may be of some help for some one. Think i can start from here if it works. Have a costume graphics that is more modular and people can add there stuff like as mention holographic design. If we can make this code modular, it will be easy to add other styles of graphics.

Still, i don't know i will take a step at a time, because i'm not expert. But it will be nice to have a engine that have all the code modular. Any one can add new graphics or things to it. This is the objective of the Box, a engine that serves to study and development of engines and projects like games.

https://www.codeproject.com/articles/363908/simple-two-file-graphics-library-for-c-cplusplus

Libraries

 A costume code editor to manage stuff dedicated to our style of code. And mainly for C language.

In the end might end up using all of them or what is best since C is modular we may add several things:


It should possibly manage, external librarys :

  • GTK 4.x
  • Ray Lib
  • Ncurses
  • Graphics.h
  • Vulkan
  • GraphApp



  • Graphic.h - for librarys development
  • Ncurses - applications in console or basic things
  • GTK - more complex things
  • Ray Lib - graphics or games development.
  • Vulkan - High graphics performance.

Facebook Page

  See if we can have some community around the software with a Facebook page : https://www.facebook.com/The-Box-101342814696181/?modal=admin_todo_tour


Added a couple more tools like the encrypt and links manager tools for example : to not have links running around company's and probably hackers exploit a lot the information on the users. This will allow to have things protected inside the computer even if some one hack the computer cant access the information that easy.

the encrypt.c tool will be in the folder "tools".

Also now all tools or topics have tutorials on the top of the page for example :

the encrypt tool "encrypt.c" :

// http://www.trytoprogram.com/c-examples/c-program-to-encrypt-and-decrypt-string/

A tutorial on how to encrypt

the projects tool "projects.c" :

//#include <stdio.h>

//#include "application_structures\file.h";

// https://www.tutorialspoint.com/c_standard_library/c_function_getchar.htm

// https://www.tutorialspoint.com/c_standard_library/c_function_gets.htm

// https://www.tutorialspoint.com/c_standard_library/c_function_scanf.htm

// https://www.tutorialspoint.com/cprogramming/c_pointers.htm

// https://www.tutorialspoint.com/c_standard_library/c_function_fprintf.htm

// https://www.tutorialspoint.com/c_standard_library/c_function_fputs.htm


// https://www.tutorialspoint.com/cprogramming/c_file_io.htm  file open

// https://www.tutorialspoint.com/c_standard_library/c_function_strtok.htm explode

/*
https://www.w3resource.com/c-programming-exercises/linked_list/c-linked_list-exercise-1.php
https://www.dummies.com/programming/c/how-to-create-a-linked-list-in-c-programming/
*/

It detail all functions used to make it work.

----

This will make very easy to follow and to grab the code, which is very hard in most projects.

Software

  Found this introduction to C, it speaks of the benefits of using C. 


If any one want to help or follow there are instruction on how to start using C, with Codeblocks. Very easy to set up.


https://www.programiz.com/c-programming


The article speaks that C, is cross platform, probably is one of the reasons it was adopted in Linux. It was not: [quote]Linus stubbornness[/quote] - Lyberta.

https://www.codeblocks.org/

Future of programming...

  " Think we are only a couple of months away of every one is capable of programing a A title. 

why the triple A. In US the max grade is not A? Should be a A title or Ace."

When i post this comment the AI was not even so big as it is now or is starting to be.

Objects in C

 I though C language does not allow objects but you can achieve something like that width function pointers. 

Found this tutorial that explain more about it,  most online tutorials like w3schools  don't focus this part of C. Go up only to variable pointers.

Actually don't know why because this is such a important part of the language. I have seen a good amount of them in projects code but the explaining why or how they are doing still "flee me" up to this point...


https://stackoverflow.com/questions/840501/how-do-function-pointers-in-c-work

Monday, March 4, 2024

Ncurses

 


Finally found a library that is simple, it have tutorials and is recently updated. The only draw back is that only works on Linux but is a minor issue since lather we can extend it to work on windows.


It works 100% width procedural code, so that is another think in favor, people looking to enter in to C, and have the same problem as me. Like it takes to long to start from scrach is not PHP. And large library's will be a bit hard to module since they already have to many dependency's as people also argue in other forum post.


Software done width this library we have VIM a famous text editor for Linux which people use for ages. The library was update in 2020 so think width all this in favors people might like it.


We can see in the tutorial the code working width getchar() a basic function on C.


https://www.youtube.com/watch?v=lV-OPQhPvSM


Snake game


https://www.youtube.com/watch?v=MH6QlYJ2SwU&list=PL2U2TQ__OrQ_TV2-wuHqGaK8qlnxgKUvK&index=1&t=0s


Old manual


https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/index.html


New version + manual


https://invisible-island.net/ncurses/announce.html#h2-overview


3D graphics;


Actually it does not do that, i was watching the tutorials and the guy explain it : "it moves the courser of the mouse  to any position on the screen or in console backward and forward" it is all that it does. While normal console only goes in strait line is much more advanced then the normal console. "Escape codes are not mention" only the mouse courser thus the name "N curses" which translates to Variable mouse cursor or manipulated mouse cursor.


"Operating system escapes", actually not again,  since Ncurses is Linux specific, to work in windows you need more code, is not cross platform. It is not in any way related to general operating systems... (but to know more on this you probably need more tutorials)


This guy writes a 3D library introduction think it will be great for people starting. The code is in C++  wdith ncurses in C, but he says we can easily translate from C++ code to C.  Since you have the code + the tutorial think will be nice. 



The end result We have a basic 3D shape working. You probably need more tutorials since he only touch the topics light, assumes you know this things.


3D Engine


https://www.youtube.com/watch?v=UJVfh8K-0wY


can check last part working : https://www.youtube.com/watch?v=1iNawdvmHRc


There are also video tutorials for Ncuses library did not post on previous post: 


https://www.youtube.com/watch?v=lV-OPQhPvSM&list=PL2U2TQ__OrQ8jTf0_noNKtHMuYlyxQl4v

How to start

 


Let's say you want to help and don't know how to.


Learning PHP first is probably better because it give much less errors then C. Then you move to C which the sintax is almost the same. Procedural clean style.

https://www.w3schools.com/

Then learn some C programming. We have a good tutorial on youtube. Should also see some books on C they have extra details.

https://www.youtube.com/watch?v=87SH2Cn0s9A&t=521s

Once you completed this tasks can start learning some Ray Lib is become almost a standard in C programming.

https://www.raylib.com/
Highly adviced joining the Raylib at redhit : https://www.reddit.com/r/raylib/


Now that you can understand some of the code can help width this software. But mainly is more about Design. Which is something very specific and hard to do. Think is harder then programming, you need even more knowledge. But see the tasks page for more info.


To execute code you will need a code editor or a IDE a integrated development enviorment which include a bit of more stuff then a code editor.

Some examples :

Notepad++

Kate if you are using Linux + KDE

Code blocks : Code blocks works well on Linux and Windows

Vulkan: Vulkan

Also for Linux Vim

Sublime Text


If you don't want a IDE may try the GCC directly is just commands.



The links missing is just the planning to update. 

https://github.com/g-truc/glm


Librarys : 

External Includes :

The Box :

The Box Web : Build in PHP, still need some more stuff done.

Ultima Online Clone in Ray Lib :

My experiment width Open Game art stuff, what to convert Ultima to C and to Ray Lib, a bit of work. This a project that going to need some help, because the Box already consume a lot of time. Or have to wait until i have it working. 


Found two books in C in the library they explain a lot of things.

 


 

If you want to follow along sugest you can also search for books. Online Tutorials and tips, aren't good enough because if you skip any detail you can mess especially width a language as complex as C.

[b]C includes[/b] are compiled in .object files so you can't access the source code. You can't learn width the basic stuff.

In the books they give the code to this basic functions which allow to create a include "general manipulation in C". Much easy to learn if the basic stuff is available. We will need to manipulate much code as possible to match the "standard programming names" referenced befo
re.

Also they explain how to implement Unit Tests nothing to do width the online code that must curious people are posting "compared width professionals".

Stuff I think I will add to Git Hub (didn't add them at the moment because I didn't have that much time to work on the files) :

- #general_manipulation_c
- PDF : Standard programming names (can include also the functions, not just variables (from "standard variables" mentioned).
- #unit_tests for general_manipulation_c (make the code extremely bug free)
- main file or run file to access things more directly, code and unit tests.

things in mind : Lyberta "i don't like C prefer C++"

We can manipulate a bit C to look more like C++ , it all depend on how you do things.

Think the end result will be: C looking a bit more like PHP because we can create auto code as we like.

lets say PHP already have "serialized" functions for characters , we can create also this things in our include. Looking at this code/explanation don't think or made me think if we relay needed PHP. We could create most of this stuff in functions in C.
 
For example : for people who don't know that much : like we could have a main function width many stuff which prevent to script all the small details.

Another aspect that it added to the argumentation on C in the book, they say C can achieve a performance equal to assembly which was another plus.

lets see how it evolves for now this is my contribute.

LInks 2

  The links list.


Theres a lot of good open source tools today it took a couple of years for them to become stable but today we can say we have a large set of high quality tools available.

Project

  • Git Hub - https://github.com/saintsoftware/the-box
  • Facebook - https://www.facebook.com/profile.php?id=100038794916328
  • Media Fire - https://www.mediafire.com/folder/numb2imcdi21c/the_box


Tutorials 

  • W3schools - https://www.w3schools.com/
  • Tutorials point - https://www.tutorialspoint.com/cprogramming/index.htm

  • Platforms

    • Indie DB - https://www.indiedb.com/
    • Open Art - https://opengameart.org/
    • Free Models - https://free3d.com/
    • Blend Swap - https://www.blendswap.com/
    • Reddit - https://www.reddit.com/r/portugal/

    OS

    • Ubuntu - https://ubuntu.com/
    • Arch Linux - https://archlinux.org/
    • Open Suze - https://www.opensuse.org/

    Editing

    • Blender - https://www.blender.org/
    • Krita- https://krita.org/en/
    • Audacity - https://www.audacityteam.org/
    • Gimp - https://www.gimp.org/
    • Libre Office - https://www.libreoffice.org/
    • Make Human - http://www.makehumancommunity.org/
    • GCC - https://gcc.gnu.org/
    • Xampp - https://www.apachefriends.org/index.html

    Game Design

    • Tiled - https://www.mapeditor.org/

    Code 

    • Notepad++ - https://notepad-plus-plus.org/

    • Kate - https://kate-editor.org/pt-pt/
    • CodeBlocks - http://www.codeblocks.org/

    Librarys

    • GTK  - https://www.gtk.org/
    • Ray Lib - https://www.raylib.com/
    • Ncurses - https://invisible-island.net/ncurses/announce.html

    Tutorials & Links

     C tut - https://www.programiz.com/c-programming


    Graphapp - http://www.enchantia.com/software/graphapp/


    Simple interface - https://stackoverflow.com/questions/39025074/c-program-how-to-print-in-table-format-alignment


    encrypt tutorial - http://www.trytoprogram.com/c-examples/c-program-to-encrypt-and-decrypt-string/

    C vs C++

     Check Torvalds open source page : https://github.com/trending/c


    Torvalds hates C++ ? (comment) 

    Naaa is a proven fact debated on the forums that C++ or objects for that matter are slower. C with pointers have a very stable performance. Is the lower language available, which is more or less easy to write, some parts are written in Assembly.

    Try for your self a 3D engine build in C# sharp since you like so much, its is incredible slow in a computer with 10 or more years like my own.

    C++ can achieve better performance then C# Sharp,

    is true but still is not that much good to develop a operating system since, it does not achieve the same performance as pointers. (and im not sure if you can access all that stuff needed for hardware in a high level language)

    Windows languages : C, C++, C#. Some parts in assembler.  It's build the same way as Linux.

    Maybe width the new computers that does not matter, but this is how thing are made. You should read more about low level programming language. The ones are close to machine code have more performance. They are harder to programme but have more performance.

    One time i load a 3D engine in C# so slow that i could not even move around the map. For example Unity 3D is build in C++ is hard to do any thing at least i can move around in a 10 years computer. 


    Why high level is slower in terms of performance ?

    Objects are a entanglement of data, so they are bit far way for the zero and one that the computer understand. So that mean after compiled more CPU activity to be done. Is simple as that. The more you entagle and nest slower it becomes. 2 entangle While loops are slower then 2 separeted while loops.   

    Is the same code the same language the same things... Is not about programming paradigms. Simple it consumes more references. Which will take more time to perform.

    Why use high level? 

    Mainly because you can code more in less time and hope computers evovle so that perfomance is not noticed.

    Assembly is closer to computer language, but extremely hard to program. You can see a code example for assembly:

    mov    edx,4        ; message length
    mov    ecx,msg        ; message to write
    mov    ebx,1        ; file descriptor (stdout)
    mov    eax,4        ; system call number (sys_write)
    int    0x80                ; call kernel

    It's performance much more higher then C. Can search games build in Assembly like Tycoon. Was build in assembly. At the time they din't have computer capability to process that much amount of objects in the screen so they have to program it in assembly so that the game could be created in that time\date.

     It have a extremely high performance for the time. It loaded a lot of stuff, think no other game does that at that time .

    Another pratical Example Quake 3 Vs Unreal Tournament

    - Quake 3 Have barly any frame loss https://www.youtube.com/watch?v=xfdnMoaWHZo

    -  While Unreal tournament made in C++ have high amount of frame loss  : https://www.youtube.com/watch?v=UzxaGj6UCUg&t=45s

    Why adopt C language

     Reasons to adopt the language: 


    • A main reason is that Linux is build on C. If you plan to go for the open source community you should adopt same language.  
    • 2ยบ For low level stuff you need to access memory and you can only do that width pointers which are not available in higher level languagues.
    • The speed that the language offers is one of the greatests.
    • Stability since is so old you have many things available if one library does not do it there are many others that can do it.
    • I personaly don't like entangle languages like javascript and C#. Where your functions have this large objects all entangled...
    • Think the family of : PHP and C have a much more clean sintax.
    • Since so many things now are in PHP and C hard to say that a new language are going to pass them. The thing that we see is evolution of the languages. New funcionality being added. 

     There will be a lot of news in things, think width the very nice and simple language like C we can have a stable project or stability, so that the project will be "durable". Or we can put the standards to work to have several projects, working width the same thing. Like you go in to a project you do not know still you can call functions and test things based on this principles.


    Think is every thing. hope i will have the files ready for next post, to start to having something for people to work on.

    C work space. in C we can work width a workspace which are a few files not include but connected by the linker, this can be a bit confusing since most languages work width includes. No sure if there is update on that on the new norm, to have more compatibility width includes:

    ansi c norm is the oldest it give more compatibility
    iso 99 is the newest 

    for problems probably the old is better. for new code and fixes better the new.

    How to learn programming

     Theres a lot of requests for people to start learning maybe create something more elaborated.


    The first language that you should learn is PHP.  All languages work the same way. Once you learn one you know a bit of the others. This is way you should start width the simplest since they are all equal at some level.

    To follow this project think you just need:

    • PHP -> A intro do programming in a simple language
    • SQL ->  Databases 
    • C -> Same sintax as PHP but more complex 


    For more knowlege on how programming languages work in general :

    • PHP -> 
    • SQL -> 
    • Python -> Browser Games 
    • Java -> Web and modular things
    • C. 
    .
    For web browser only
    • HTML-> Raw interface and browser data management
    • CSS -> Desing of interfaces in the browser 
    • Javascript -> basic  dinamic tasks on the browser
    • PHP -> 
    • SQL ->
    • Bootstrap -> Web framework (inludes javacript\CSS)

    For web browser and devices like android

    • HTML-> 
    • CSS -> 
    • Javascript -> 
    • PHP -> 
    • SQL ->
    • Bootstrap -> 
    • Python -> 
    • Java -> 
    • C
    If you plan to go in to new stuff and develop graphics :

    • C# -> main engines use it and is the natural language for windows. The sintax is not as clean as C. The performance is very poor width all this objects entanglement. In a way is kind of a low high level language. Is low level but entangle so much that is high level.  
    • Rust -> a new language that have been adopted C principles but attempt to be more high level. Kind of mix of Python and C.
    • C++ -> many graphics are written in C++ like unreal ungine open GL. Is not as fast as C but to manage higly complex projects the objects may be needed. This is way in the long run C is better. You may have things done faster but they don't have quality of performance. Still this easy ro program and the entanglement of objects made graphics available to more people in Open Gl and other projects.
    • D -> I give a pick on what is D language. And is a language that is done specific to Amazon and have all the new funcionality is kind of a C updated.
    For Operating Systems & Hardware:

    • Assembly -> Only need assembly if to plan to work width hardware directly. some things in graphics are still done in assembly think most open Gl low level stuff. Is extremmly hard to learn and very little modularity. Assembly only works on one arquitecture. These meens if you need to work on a diferent processor you need to do all the code again. The performance that it achieve is the best thing Amiga\Comodore where done in assembly since they have the same processor throw a serie of games.


    Javascript 

    Think javascript is one of the hardest language to learn since. Is poor written and poor documentend. On top of this you get wierd bugs all the time. The way the language is written is bad because you can only access thing throw objects there are no global things like in C\PHP or in C++ objects.

     Don't know if i should advise it. But If you are only focused on web software you should also learn. 

    Java

    What else can we say... Java is a bit under-rated since is very powerfull and very litle used. 
    These game Runescape which is great is done in Java. If you are not looking for something crasy and just want things to work Java is the most modular language that exist that can done all the stuff you need. Due to the fact that is highly modular it delegates to litle to you. Obvious when you know a bit more and have more resources $$$ can increase performance width a language like C.

    Runescape

    Python

    For webbrowser Games think Pygame is becoming a standard. Since javascript is to limited and in general a weak language. Things is evolving to Pygame most of the games i played in the browser they all where in Pygame. Python becoming very strong in thermes of stability that it can present to devs. Most of this games have no bugs. My last game that i attempt to load in action script was highly bugy compared to the pygames that work very well. Also unity web lost bit since it was to heavy because is not open source. Now that hey have a good quality tool in Python don't think for this simple web games they are going to back to Unity. 

    Can check this i'm talking at their page hundreds of titles develop:

    https://games.renpy.org/

    Linux

    C language in a way is a good pick because Linux is done in C. Many projects in GitHub are in C. Is one of the most used languages for low level. Onether fact is the performance that it can achieve.   
     
     

    Tutorials web sites


    https://www.w3schools.com/

    Tutorials points also have a lot free stuff but they put pay content up from so you have to dig a bit. You can see in the links C++ and C free tutorials.

    https://www.tutorialspoint.com/cplusplus/index.htm

    https://www.tutorialspoint.com/cprogramming/index.htm

    Used this site for some time but think they kind got out dated by w3schools

    http://www.tizag.com/phpT/

    pastebin have a lot of stuff but only works width google. Try pastebin + what you want in google.

    https://pastebin.com/index.php


    https://www.programiz.com/c-programming/


    CodeBlocks & Kate

    Think this two editors are the main ones at the moment. Kate is very simple and light weight to workd. While Codeblocks if you need to do C compilated work it comes width Gcc and is a editor directed to work width C\C++ Fortran.  If for some reason compiler is not working as it happen to me you have to install gcc directly in Linux is just a command.

    https://kate-editor.org/pt-pt/

    https://www.codeblocks.org/


    Xampp

    For develop of web stuff people mainly use xampp which is a local server that allow to run PHP and SQL on your computer. 

    https://www.apachefriends.org/download.html



    There are some nice tutorials on C in youtube on the moment


    If you wish to follow start width a couple of video tutorials.


    Conclusion

    You can see by your self that by the knowledge requierments. That in the end this project is the most simple. People have done this big mess width programming over the years. Is not dev enteirly fault since many projects evolve separitly others only now are maturing. I shaw this comment "how hard is to load something in to the monitor in 2023?". This is a direct reference to the big mess that happen in programming. Most high knowledge was accumulated by companys that do not care about the community and to share it. Most of what we have today is due to individual people who contributed width small exceptions of some stand alone project which where released as open source by companys.

    C language Mini Manual

     Adding relevante parts of the C language in to a mini manual. To have the information resumed and updated :


    A basic file in C it uses the .c extension  : mini_manual.c  // any coding editor can create this file

     A C program consist of this structure :

    ----------------------

    #include <stdio.h//  system Libraries which are compiled

    #include "standard_variables.h" // user librarys which are not compiled

    // A library is a file that contain mainly other functions or variables.

    char msg1// Global variables outside main


    int
     main()   A function called main which is where the compiler\program uses as reference to know where things are or start.

    {

        char msg2// local variables inside main

      printf("Hello World!"); // Function call to display a msg

      #include "menu.c" A include file to use funcionality directly. 

        // For example our menu is hevy complex and we don't want to edit all our projects that have a menu. We can just use\reuse the same menu include. When we edit the menu.c all our projects will be updated. We just need 1 updated in a file since all others link to that file. But in this case it will depend a bit on our planning. Lets say a change is needed for one project but not the others.

      return 0;
    } 

    ---------------------------------

    // As seen in previous example we have our libraries on the top of the file 

    #include <stdbool.h// C99
    #include <stdio.h// header file type is "pre-processor" it is performed before .c files and uses .h extension in this case is a compiled system lib

    #include "../includes/standard_variables.h"  // user header file in a path above inside the includes folder. assumes a 2 folder structure  (progs includes)  comes out of 1ยบ folder to include a file in the "includes" folder.

    // And variables that can be inside or outside main

    char msg[]// Declare a string in C dinamic size

    char msg1// single character C assume 1 character if no size is give
    char msg2[10]// assumes 10 max characters long string

    int myAge = 43;     // Integer number no floating only positive and negative values - 2,147,483,648 to 2,147,483,647

    float floating = 1.5   // floating  values  also called decimal 

    Short Byte and Boolen are not available but probably there are some kind of library to do this. If you plan to work with high amount of numbers may need better declaration because program may become to large in therms of memory use.

    short  value // Numbers from -32,768 to 32,767 

    byte  value // Numbers from -128 to 127

    boolean value // 1 to 0

    Array

    int int_array[3] = {"5", "8", "9"};

    char string_array[3] = {"h", "k", "m"};


    Arrays in C are not tha valuable since they don't allow mixed data.  

    Still a good aspect is that they can improve performance since they don't allow this. 


    Mix data

    Structure declaration of mixed values .

    struct My_Structure

    {   
        int my_num;           // Member (int variable)
        char my_letter;       // Member (char variable)

        float float1;

     
    }; // End the structure with a semicolon is a type of variable and not a fucntion

    C does not suport object for mixed values this is as far you will get

    File Manipulation


    FILE *fptr
    fptr = fopen(filenamemode);
    FILE *fptr;

    w - Writes to a file
    a - Appends new data to a file
    r - Reads from a file

    fptr = fopen("filename.txt""w"); // Create a file
    fclose(fptr); // Close the file


    Librarys

    #include <math.h// Math functions library. it extends the basic funcionality of C width more functions.

    ceil(1.4// rounds up
    floor(1.4// rounds down


    Loops

     Repeats the same action X times.

    Loop example in this case 5 times.

    int i = 0// 
    while (i < 5

    {
      printf("%d\n", i); // \n is a symbol to represent new line
      i++;
    }


    Pointers 

    Are important because they improve the performance, this is the reason why C is knowed to achive high level of performance. Because they allow us to manipulate the data in the computer's memory, this can reduce the code.


    int* ptr_my_age = &my_age;  // Pointer is declared widtht the asterisk afther the variable type. The pointer variable stores the address of myAge. Width the pointes we are not accessing the variable but the adress to the variable.


    This is my guessing ... if we do not want to change a variable just to access it we gain performance by using a pointer. In this way also a constant should increase performace because is a variable that does not change. But in C we have pointers so we can achieve the same effect. 

    Pointers in a way are better then constants. Because if lather you decided that a variable is no longer static you have to change your code. While if you have a pointer you need to change less code.

     

    Function

     Functions in C most have the same return type. If will return a int it is a int function. If returns string is a string function.


    int function_sum(int k) //

    {
        if (k > 0

        {
            return k + sum(k - 1);
        } 

        else 

        {
            return 0;
        }
    }


    typedef unsigned char byte; // think this only works on header files. It allow to set new rules for the program. it creates a 256 positive values string.

    #include <errno.h>

    m

     The MVC or separete logic from presentation. is a well knowned paradigm.  Its knowned that MVC Frameworks implemented the Model View Contro...