Jump to content

Recommended Posts

Posted

C++

 

Η γλωσσα c++ ειναι μια γλωσαα προγραμματισμου που χρησιμοποιηται παγκωσμιος για δημιουργια διαφορων εφαρμογων. Δημιουργηθηκε απο τον Bjarne Stroustrup και ηταν σαν `αναβαθμηση` της γλωσσας C. Οι δυνατοτητες της ειναι απεριοριστες και μπορει φυσικα να χρησιμοποιηθει στην δημιουργια video games.

 

Τι σχεση εχει η C++ με το lineage?

Το γνωστο σε πολλους L2OFF, που χρησιμοποιηται στην δημιουργια l2 σερβερ ειναι γραμμενο σε C++.

 

Τι χρειαζομαι για να αρχισω να προγραματιζω με την C++?

Χριαζεσαι σε αυτην την περιπτωση εναν compiler. Ενα πολυ γνωστο IDE (περιβαλλον εργασιας) ειναι το CodeBlocks που εχει ενσωματομενο compiler, ειναι free και ευκολο στην εγκατασταση.

 

Τωρα ωρα για καποια basics

 

Δημιουργηστε με το codeblocks ενα καινουργιο project τυπου `Console Application`.

Υστερα πηγαιντε στο main.cpp και ακολουθηστε τα παρακατω.

 

Πρωτα πρεπει να κανουμε include ενα βασικο library που ειναι ιδιαιτερα χρήσιμο.

 

#include <iostream>

 

Υστερα πρεπει να φτιαξουμε το βασικο function main(). Οτι θελουμε να `φαινεται` και να επιδρα στην εφαρμογη μας πρεπει να το γραψουμε μεσα στο main().

 

int main() {

}

 

Τωρα ωρα να αρχισουμε να γραφουμε των κωδικα απο το προγραμμα μας. Θα χρησιμοποιησω την πολυ απλη `εντολη` std::cout. Με αυτην την εντολη θα εμφανιστει καποιο text στο παραθυρο μας.

Οποτε γραψτε μεσα στο main()

 

std::cout << "Hello there!" << std::endl;

 

Οταν το κανετε compile σε debug mode (υπαρχει το debug mode και το release mode) θα εμφανιστει ενα παραθυρο που θα γραφει "Hello there!". Το std::endl παει στην απο κατω γραμμη. Οποτε αν γραψετε κατι στην συνεχεια θα βγει απο κατω.

 

Αν το κανετε compile σε release mode το παραθυρο θα ανοιγο κλεισει. Αυτο διοτι λεμε στο προγραμμα να γραψει κατι αλλα απο τη στιγμη που το κανει και δεν εχει τι αλλο να κανει κλινει.

 

Γι'αυτο παμε στην αρχη, βρισκουμε αυτο:

 

#include <iostream>

 

Και απο κατω βαζουμε αυτο:

 

#include <windows>

 

Τωρα παμε στο τελος του εγγραφου πριν το } και γραφουμε:

 

system("pause");

 

Αυτη η εντολη λεει στην κονσολα να σταματησουν τα παντα μεχρι να πατησεις καποιο κουμπι. Με το που πατησεις καποιο, το παραθυρο θα κλισει.

 

Για οσους ενδιαφερονται να φτιαξουν μικρα παιχνιδακια χωρις γραφικα εχω φτιαξει καποια βιντεο που θα σας βοηθησουν.

 

 

 

Μπορειτε να βρειτε κιαλα στο καναλι μου στο youtube.

http://youtube.com/phpavlos

 

Credits: Me

 

  • 3 months later...
Posted

Πολύ καλός οδηγός! Μπράβο σου!!!

 

Απλά γιατί δεν γράφεις για την αντικειμενοστράφεια? Εξάλλου για αυτό δημιουργήθηκε η C++ :D

  • 2 months later...
  • 1 month later...
  • 6 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • If you want to make your thread stand out a bit more, adding quick proof pics or a small stock update usually helps buyers feel safer. I’ve had smoother chats with traders after doing that. On a side note, when I’m taking a break from trading, I mess around with the security puzzles in ModsCraft, which has been a fun way to clear my head between deals.
    • ━━━━━━━━━━━━━━━━━━━━━━ L2-SCRIPTS UPDATE ━━━━━━━━━━━━━━━━━━━━━━ Dear MaxCheaters users, We have updated the prices in the first post. Specially for the MaxCheaters community, we significantly reduced prices on many of our old developments, archived projects and source packs. Most of our older Lineage 2 sources are now much more affordable than before, including many Classic and Essence projects. This is a great opportunity for smaller teams, startup servers and developers who always wanted to work with our projects but previously could not afford them. ━━━━━━━━━━━━━━━━━━━━━━ For the past years we were mostly absent from the public scene because our team was working privately on large projects and contract-based development. During this time we accumulated a huge amount of private materials, systems, source codes, client modifications, website solutions and infrastructure developments that were never publicly released. Now, according to completed agreements and partnerships, we finally have the ability to publish and offer part of these materials as our private services and developments. In the upcoming weeks we will also publish a list of our works and services from the last 5 years of private development. ━━━━━━━━━━━━━━━━━━━━━━ Upcoming publications will include: • Private server development • Custom gameplay systems • Client modifications • Websites & ACP systems • Protection solutions • Infrastructure solutions • MMO / Web projects ━━━━━━━━━━━━━━━━━━━━━━ Thank you to everyone who stayed with us all these years.   Telegram:  @L2scripts Websites:  L2-scripts.com    L2-scripts.ru    Mmore.dev Sguard site:  Sguard   Best Regards! ━━━━━━━━━━━━━━━━━━━━━━
    • Tightening the timer to fifteen minutes sounds spot on, especially for players who don’t want to sit around waiting. I’ve had a few hosting hiccups on past projects, and sorting out configs felt a lot like the headaches I solved after dealing with armadiofashion.com for a separate issue where a server kept failing to connect. Little tweaks like that usually smooth things out fast.
    • Could you please re-upload the files 😞
    • We are back on MaxCheaters.   After a long break, we are officially returning to public activity and support for our projects. During this time, SGuard has been heavily reworked: some outdated features were removed, the architecture was simplified and optimized, and the protection itself became more stable, faster, and easier to use. Our goal has always been simple — to provide a protection system that actually works, does not create unnecessary problems for administrators, and does not turn server maintenance into a constant battle with bugs and configuration issues.   What we offer now: • Updated version of SGuard • Simple and fast installation • Stable operation without constant crashes • Support for old and latest chronicles • Java and PTS support • Regular updates and technical support • Private solutions for large projects   We continue to improve our products and are once again open for new clients and partnerships. Thank you to everyone who stayed with us all these years.   ---------------------------------------------------------- Telegram: @l2scripts   L2S Guard: http://guard.l2-scripts.com L2-Scripts Studio: https://l2-scripts.com Private Development: https://mmore.dev
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..