<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hi, <br><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">&gt;&gt;I don't know what you mean with "debogue from c++". Do you mean
"debug"? What are you doing? Are you typing something? Are you clicking
&gt;&gt;with the mouse on an icon?<br>debogue (in french) it means debug: i just click on an icon with mouse . after building project in C++ i must debug it by clicking on icon "start debugging". that i do with any example of itk. that 's why i said i don't know where can i gives the arguments.<br>Thank you<br><br>Regards<br>Syrine<br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">De :</span></b> Ramón Casero Cañas &lt;ramon.casero@comlab.ox.ac.uk&gt;<br><b><span style="font-weight: bold;">À :</span></b> Syrine Sahmim &lt;syrine.sahmim@yahoo.fr&gt;<br><b><span style="font-weight: bold;">Cc :</span></b> insight-users@itk.org<br><b><span style="font-weight: bold;">Envoyé le :</span></b> Mardi, 4 Août 2009, 19h44mn 35s<br><b><span style="font-weight: bold;">Objet&nbsp;:</span></b> Re: [Insight-users] Re : Need to correct this
 example<br></font><br>Syrine Sahmim wrote:<br>&gt; Hi,<br>&gt; I'm really ashamed. i know i disturb you from your work.i have buy a book of c++ and i use internet but in&nbsp; vain i still don't know many things and i still learning at the same time. i will try and try to command better c++ and itk.the begining is still difficult.Really thank you for your help but want to konw others things if itis possible:<br><br>Hi Syrine,<br><br>Nothing to be ashamed of, but yes, it seems that you need to get yourself familiar with programming.<br><br>What's your background? Are you taking a course in programming, are you in college...? Do you have access to lectures or a technical library?<br><br><br>&gt; you have said :<br>&gt;&gt;&gt; Do not do that. Pass the arguments in at the command line properly.<br>&gt;&gt;&gt; Also if argc =2 then only argv[0] and argv[1] are valid. C starts<br>&gt;&gt;&gt; counting at 0.<br>&gt; please explain more to me what i must do
 step by step:<br>&gt; how do&nbsp; i&nbsp; pass the arguments at the command line properly . it's one of my problem? what i must do exactly<br>&gt; all i know that i debogue from c++ and after that i'll have the ms dos screen and i haven't the posibility to write the arguments in this screen because it's mentioned that i should clik to any key in the key board.<br><br><br>I don't know what you mean with "debogue from c++". Do you mean "debug"? What are you doing? Are you typing something? Are you clicking with the mouse on an icon?<br><br><br>The command line, or command prompt in Windows [1][4], is typically a black window with silver letters. You can type commands there (you don't use the mouse). A command will usually run a program.<br><br>For example, if you have a program called "RegistrationExample.exe", then you can run it by typing<br><br> C:\&gt; RegistrationExample.exe<br><br>Now suppose that your program needs some input arguments, for
 example 2 DICOM files with the data you are trying to register.<br><br>Suppose also that this program in particular expects the first input argument to be the file name of the fixed image, and the second argument to be the file name of the moving image. This is known as the "syntax". When you try to run the program without arguments, it will usually show you the expected syntax:<br><br>Syntax:<br><br> RegistrationExample.exe fixed.dcm moving.dcm<br><br><br>So now you want to run something like this, using the command line<br><br> C:\&gt; RegistrationExample.exe heart1.dcm heart2.dcm<br><br><br>OK, so this is all from the point of view of the user and the command line. Now we are going to look at this from the point of view of the person writting the C++ program.<br><br>When you are writing a program in C++ yourself, or using one of the Examples in ITK, what you get is a source code file with extension .cpp, that contains several things.<br><br>One of
 these things is the "entry point", that is, the main() function [2].<br><br>A common way of working with main() is the following<br><br>&lt;CODE&gt;<br>int main( int argc, char *argv[] )<br>{<br><br> // your program code here<br>}<br>&lt;/CODE&gt;<br><br>argc is a numerical variable, and it contains the _number_ of input arguments.<br><br>argv is an array of strings that contains the _input argments_.<br><br>For example, if you call your program with<br><br> C:\&gt; RegistrationExample.exe heart1.dcm heart2.dcm<br><br>then you will have<br><br> argc --------&gt; 3<br> argv[0] -----&gt; "RegistrationExample.exe"<br> argv[1] -----&gt; "heart1.dcm"<br> argv[2] -----&gt; "heart2.dcm"<br><br>You can read more about this with a Google search, for example [3]<br><br><br>[1] <a href="http://en.wikipedia.org/wiki/Command_Prompt_" target="_blank">http://en.wikipedia.org/wiki/Command_Prompt_</a>(Windows)<br>[2] <a href="http://en.wikipedia.org/wiki/Main_function_"
 target="_blank">http://en.wikipedia.org/wiki/Main_function_</a>(programming)<br>[3] <a href="http://publications.gbdirect.co.uk/c_book/chapter10/arguments_to_main.html" target="_blank">http://publications.gbdirect.co.uk/c_book/chapter10/arguments_to_main.html</a><br>[4] <a href="http://www.bleepingcomputer.com/tutorials/tutorial76.html" target="_blank">http://www.bleepingcomputer.com/tutorials/tutorial76.html</a><br><br>Cheers,<br><br>Ramon.<br><br>-- Ramón Casero Cañas, DPhil<br><br>Computational Biology, Computing Laboratory<br>University of Oxford<br>Wolfson Building, Parks Rd<br>Oxford OX1 3QD<br><br>tlf&nbsp; &nbsp;  +44 (0) 1865 610807<br>web&nbsp; &nbsp;  <a href="http://web.comlab.ox.ac.uk/people/Ramon.CaseroCanas" target="_blank">http://web.comlab.ox.ac.uk/people/Ramon.CaseroCanas</a><br>photos&nbsp; <a href="http://www.flickr.com/photos/rcasero/" target="_blank">http://www.flickr.com/photos/rcasero/</a><br></div></div></div><br>



      </body></html>