ข้อมูลของบทความนี้จะเกี่ยวกับnamespace หากคุณกำลังเรียนรู้เกี่ยวกับnamespaceมาสำรวจกันกับSelf Directed CEในหัวข้อnamespaceในโพสต์Namespaces in C++นี้.
Table of Contents
เนื้อหาที่เกี่ยวข้องnamespaceที่แม่นยำที่สุดในNamespaces in C++
ที่เว็บไซต์Self Directed CEคุณสามารถเพิ่มความรู้อื่น ๆ นอกเหนือจากnamespaceสำหรับข้อมูลที่เป็นประโยชน์มากขึ้นสำหรับคุณ ในหน้าselfdirectedce.com เราอัปเดตเนื้อหาใหม่และถูกต้องสำหรับผู้ใช้เสมอ, ด้วยความปรารถนาที่จะให้บริการข้อมูลที่สมบูรณ์ที่สุดสำหรับคุณ ช่วยให้คุณอัพเดทข่าวสารออนไลน์ได้อย่างรวดเร็ว.
คำอธิบายที่เกี่ยวข้องกับหัวข้อnamespace
Patreon ► Twitter ► Instagram ► Discord ► Series Playlist ► ขอขอบคุณผู้สนับสนุน Patreon ต่อไปนี้: – Dominic Pace – Kevin Gregory Agwaze – Sébastien Bervoets – Tobias Humig – Peter Siegmund – Kerem Demirer Gear I ใช้: ——– ——— แล็ปท็อปที่ดีที่สุดสำหรับการเขียนโปรแกรม! ► แป้นพิมพ์โปรดของฉันสำหรับการเขียนโปรแกรม! ► จอภาพที่ชื่นชอบสำหรับการเขียนโปรแกรม! ► กล้องหลัก ► เลนส์หลัก ► กล้องที่สอง ► ไมโครโฟน ►
ภาพถ่ายบางส่วนที่เกี่ยวข้องกับหัวข้อของnamespace

นอกจากการดูข้อมูลเกี่ยวกับบทความนี้แล้ว Namespaces in C++ สามารถดูและอ่านข้อมูลเพิ่มเติมได้ที่ด้านล่าง
คำหลักบางคำที่เกี่ยวข้องกับnamespace
#Namespaces.
thecherno,thechernoproject,cherno,c++,programming,gamedev,game development,learn c++,c++ tutorial,namespace,namespaces,using namespace std,using namespace,tutorial.
Namespaces in C++.
namespace.
หวังว่าการแบ่งปันที่เราให้ไว้จะเป็นประโยชน์กับคุณ ขอบคุณมากสำหรับการอ่านnamespaceเนื้อหาของเรา
its "caer" not "chur"!!
genius
can't classes also solve the naming issue
You teach very fast. You are experienced. But not everyone here. So teach slowly one by one. Don't confuse. Nobody is in hurry here.
What are anonymous namespaces good for?
Thank you for the great videos. This is my first day watching your videos. And i love your explanations! And for some reason, the videos you made are so easy to watch! 12mins video ended quickly as if it was a 3minutes vid.
Wait, so if you think about it, namespaces are used to avoid name conflicts, and "using namespace" is an intruction to remove that namespace, but you may have name conflicts again, since the functions in that namespace no longer have an id, so "using namespace" is actually like losing the point of namespaces
What would it mean for a variable or function to be static inside a namespace? Can you have private functions in a namespace which are only visible to other functions in that namespace?
"Back in the days of C". Me, a C Developer: 😢
May I ask why we don't need to do #include <std::vector>?
Is it okay to put namespaces around just #defines?
The simple solution to avoid writing std::cout and std::cin and std::endl would to just use #define, cause I dont think anybody would want to use a custom cout,cin or endl
#define cout std::cout
#define cin std::cin
#define endl std::endl
A namespace inside a namespace – talk about organisation. 🤯
I'm learning namespaces because Ivor Horton told me to do so.
Cherno's hand gesture in the beginning of his vids is literally something out of a videogame. The movement is so smooth.
the baisc purpose of the namespaces is to prevent the naming conflicts
Will anyone ever need to put a nested namespace in any scenario?
Thanks for this quality content!
I believe people will appreciate a discusion on anonymous namespaces
namespace not_std = std;
love my friend
I was watching on 1.25 speed and after a few minutes i forgot about that and got surprised and impressed by the speed of your typing lol
This doesn't really cover anything more than what you would see in the first few paragraphs of any section on namespaces in any book. I would expect that you would cover more nuanced uses of namespaces. You mentioned only briefly that one could have a nested namespace, but you did not explain why one would use one or why they should be avoided. You also didn't talk at all about organizing a collection of various libraries, with some in some namespaces and some in other namespaces, or what would be some best practices for deciding which library goes into which namespace.
Constantly waiting for the dude to accidentally smack that cactus with the back of his hand.
this was the BEST explanation!
I was getting so angry with people just being like "yeah just put std:: infront of stuff and that'll make it work"
Nice to have someone just not be a cock and EXPLAIN things. idk why people treat other like they're idiots.
Anyway. Mad video friend. Thanks heaps!
hi cherno thanku very much for this tutorial
If you suggest not using namespaces in header files, why do you do it in your hazel building a game engine series? (video 5 entry point)
In the c++ standard library are all the libraries there using the namespace std?
Hey Cherno please make a video on how to generate random numbers in
C++
Hey Cherno please make a video on how to generate random numbers in
C++
dont ask me why just an example …..haha
But I believe the Object Encapsulation in C++,
has protected symbols (mem-func()s and mem-vars)
from being conflicted, to some degree.
E.g.
class A {
void myFunc();
}
class B {
void myFunc();
}
won't be in conflict, because myFunc()
has to be referenced to,
THROUGH, the higher-level symbols, Class A or B, FIRST,
i.e. it is NOT exposed DIRECTLY to the GLOBAL SCOPE.
Neither do I like namespace.
But the problem is,
if other programmers are using it,
and you are working in teams with them,
or working on / extending / modifying their code,
then you've got to undestand namespace.
Unless you are an absolutely solo programmer,
developing everything on your own from scratch.
Is it not just the same as just having the name of the library like glfw and then a dot to indicate something inside the library? Like glfw.destroy()? Why does c++ use namespaces instead of doing it like that? This is just confusing for me as iostream doesn't use iostream:: or something, no that's std::?!? In Go for example you would just import the package fmt and then all the functions inside fmt are accessible by just typing in fmt.Printf for example. Why does C++ feel the need to do it so drastically differently and confusing by not even naming the namespace the same as the package name?!
this guy is too smart for me. =(
bad 🙁
Which IDE you're using.
What is your name?
can i do this?
namespace a{
#include <trashyC-code.h>
}
? greets
@7:17 below my mind! That's the exactly answers to some of my questions regarding using namespace in C++;
Thank you Cherno!
You are extraordinary amazing!
if an user defines a function then in which namespace will it fall??
This is awesome, cleared up a lot for me!
cool
Thanks TC!
This is sorcery
I don't know how do you do that, but after watch more than 60 videos, you still able to maintain the quality and didactic. Thank you!
You are a great teacher man!
Hi Chemo, thank you. Please tell me
namespace has nothing to do with physical directory location ?
eg 2 functions with identical name in directories /a/b/print.cxx and /a/b/c/print.cxx can still be confused by compiler?
Thank you!!