D program code

John Colvin john.loughran.colvin at gmail.com
Wed Nov 13 06:45:51 PST 2013


On Wednesday, 13 November 2013 at 14:36:22 UTC, Vincent wrote:
> import std.stdio,std.cstream;
>
> void main(string[] args)
> {
> 	int first;
> 	int second;
> 	
> 	write ("First Number     : ");
> 	readf (" %s", &first);
> 	
> 	write ("Second Number    : ");
> 	readf (" %s", &second);
> 	
> 	int result = first + second;
> 		
> 	writeln("Result: ", result);
> 	din.getc();
> }
>
> _________________________________
>
> Problem: When I run this code why it is automatically exit when 
> it shows the
>          result. It allows me to input first numbers and second 
> number but when
>          it shows the result it will totally exit and I can't 
> see the output.
>
> I use D-IDE as my editor and dmd2 as my compiler.

I see you've got plenty of answers so I'll just add: please ask 
such questions in digitalmars.D.learn 
http://forum.dlang.org/group/digitalmars.D.learn


More information about the Digitalmars-d mailing list