Simple Questions

I have a few more questions for C++.

First question is:

I understand and am familiar with cout.

However on this forum I have seen people using:

std: :cout or something similar to it.

Can someone please explain the difference?

I usually use something like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <Windows.h>


using namespace std;

int main()
{
	cout << "Hi, my name is Irhcsa."

		//But then I see someone use something like:

	std: : cout << "Like this?"

		 //Please explain the difference if you can.
}


Second question is:

I recently learned and have played around with deleting empty folders. I used the following to delete an empty folder:

DeleteDirectory("C:/Program Files/DeleteMe);

But now I am trying to get more creative. I placed a text document inside of the empty folder I have created.

I have tried using something I found searching online but this didn't work:

 
system("del C:\\Program Files\\DeleteUs.txt); 


I want anyone reading to know that I am not just posting these for people to "do my homework" or because I am lazy. I have actually searched for the answer with no success. Also, I am 23 and in the Army so it has nothing to do with homework. I am just curious and starting my path to becoming great at C++.

Thanks!

-Irhcsa
:: is the scope resolution operator, there cannot be a space between the two colons.

http://tinyurl.com/macpuyu
I clicked your link and viewed the top 3 topics and still do not fully understand.

I see a lot of people saying it is considered "bad habit" because libraries can collide or something.

I don't want to come off as being disrespectful but is there a way you can explain it more "dumbed down" please?

Is the way I'm it incorrect? or should I start just doing:

 
std:: cout  << "Hello";


Thanks again.
Last edited on
You should look up what a namespace is:
1
2
3
4
5
6
7
8
9
10
11
12
13
namespace hello
{
    int x;
    namespace there
    {
        int y;
    }
}

//...

hello::x = 7;
hello::there::y = 4;
Topic archived. No new replies allowed.