Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips


1-20 of 163     Previous     Next
Using SendKeys in C#
by Hannes du Preez
Language: .NET, Expertise: Beginner - You can use SendKeys to send a different keycode from the one that was pressed.
Executing a Subprocess
by Lundholm Per
When executing a subprocess in Java, remember to read both the stdout and stderr from the process or it may be blocked.
Declaring Destructors Virtual
by Sophy Pal
Writing basic classes needs no more definition from the programmer than just declaring a few member functions and variables. But, what if you needed to design a class that was derived from other ...
Send All Your System Messages To File
by Kesav Kumar
Often, while developing a system you want to debug it using System.out.println or System.err.println. When development is over you would like to send all those messages to file. The easiest way ...
System.out Vs. System.err
by Nitin Garg
System.out leads the output to the standard output stream (normally mapped to the console screen). System.err leads the output to the standard error stream (and, by default to the console, as ...
Shortcut for System.out.println()
by Patrick Phillips
Tired of typing
Sending a Cookie to a Server Through a HttpURLConnection
by Sandeep Gain
The java.net.HttpURLConnection class provides HTTP specific functionality. First you need to open an ...
Right-Justification of Output
by Danny Kalev
To right justify the output of cout, call the width() function with the size of the output screen (in characters) as an argument. In the following example, the program calls width() to ...
Alternatives to ios::nocreate and ios::noreplace
by Danny Kalev
In pre-standard C++, certain implementations of <fstream.h> offered the flags ios::nocreate and ios::noreplace for controlling file creation. These flags were too platform-specific and ...
Filtering Input in scanf()
by Danny Kalev
You can force scanf() to read only specific characters from the input source while ignoring all the rest. Alternatively, you can force scanf() to read all input characters except the ones ...
If Your Compiler Doesn't Support snprintf() Yet
by Danny Kalev
Sometimes, sprintf() is unavoidable. For example, when compatibility with C is paramount, Sprintf() has a safer version called snprintf(), which doesn't write past its buffer's limits. However, ...
<iostream.h> or <iostream>?
by Danny Kalev
Although the <iostream.h> library was deprecated for several years, many C++ users still use it in new code instead of using the newer, standard compliant <iostream> library. What are the ...
Octal and Hexadecimal Output
by Danny Kalev
By default, cout displays integral values as decimal numbers. You can override this setting and have integral values displayed in hexadecimal and octal notations by using the 'hex' and 'oct' ...
Controlling Floating Point Precision
by Danny Kalev
You can override the default number of digits after the decimal point by calling the precision() member function of an ostream object. The following program first displays six digits after the ...
Switching Between Fixed and Scientific Notation
by Danny Kalev
By default, iostream objects are set to display floating point values in fixed notation. To change this, you apply the 'scientific' manipulator to an output stream ...
Emitting a Beep
by Danny Kalev
The escape sequence '\a' is the ASCII code for a beep. To emit a beep from your program, output this escape sequence to the standard output. For ...
Streams and Pointers
by Danny Kalev
Look at the following program. It compiles correctly under every standard-conforming compiler. At first, this may seem surprising because seemingly, because it's impossible delete an object which is ...
Returns As a String The Complete Path To The Current (Working) Directory
by Robert Glover
The method shown below returns as a String the complete path to the current (working) directory. This can be useful to know because default files(including property files) are read from and ...
Maximum Number of Characters
by DevX Pro
I'm reading approximately two million characters into an array. The max number of elements that Borland Turbo C++ 5.02 allows me is not enough. Can I declare this array to be a lot bigger or allocate more memory for this array?
Generating a Unique Filename
by Danny Kalev
To generate a unique filename that won't conflict with any other files that exist in the current directory, use the tmpnam() function declared in <stdio.h> as ...
1-20 of 163     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date