Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,914 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,163 people online right now. Registration is fast and FREE... Join Now!




pointers = **<pointer name>

 
Reply to this topicStart new topic

pointers = **<pointer name>, i cant seem to really understand what the two consecutive asterisks me

mauzinisterice
12 Dec, 2007 - 09:12 AM
Post #1

New D.I.C Head
Group Icon

Joined: 1 May, 2007
Posts: 26


My Contributions
i am new in c programming and i was blocked by this code:

int main(int argc, char ** argv)
[i]

what does this line of code means?

thanks in advance!


User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Pointers = **<pointer Name>
12 Dec, 2007 - 09:37 AM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,655



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
Hi mauzinisterice,

When you start an application from something like the command line (dos prompt for example) you can pass it parameters. The number of parameters goes in argc (representing argument count) and the actual arguments go in argv (argument values).

So for instance if I start the application like so...

CODE

run myapp.exe c:/test.txt d:/test2.txt


argc will equal 2 and argv[0] will contain c:/test.txt and argv[1] will contain d:/test2.txt. The double asterisks mean that it is a pointer to an array of character strings which are pointers themselves. So it is a pointer to an array of character string pointers. I suggest you read up on the use of pointers and perhaps this will make more sense.

smile.gif
User is offlineProfile CardPM
+Quote Post

mauzinisterice
RE: Pointers = **<pointer Name>
12 Dec, 2007 - 10:04 AM
Post #3

New D.I.C Head
Group Icon

Joined: 1 May, 2007
Posts: 26


My Contributions
thanks! that helped me a lot!
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 02:12PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month