devxlogo

We are an award-winning tech entrepreneurship website where trusted experts can provide value globally.

Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.

devxlogo

Trusted for 26 years

Over 30K Articles

1M+ Readers

Expert-reviewed

10K+ Tech Terms

As seen in:

microsoft logo
business_insider_logo
wired_logo
berkley
arstechnica_logo
hackernoon

The Latest

Multiple Actions on One Event

To put two actions for one onmouseover=” ” event, just separate the two actions with a semicolon just like you would any two JavaScript statements. For example: OnChange=”alert(‘First Action’);alert(‘Second Action’)”

String Objects and C-strings: Caveats

The standard string class has a dual interface: it supports both C-style strings as well as string objects in various operations: const char text[] = “hello world”;string s = text;

Function Overloading

In order to overload a function, a different signature should be used for each overloaded version. A function signature consists of the list of types of its arguments as well

Pre-Defined Macros

All C/C++ compilers define the following macros: __DATE__ //a literal containing the compilation date in the form “Apr 13 1998″__TIME__ //a literal containing the compilation time in the form “10:01:07″__FILE__

Prefer dynamic_cast<> to typeid()

A robust, long lasting OO design relies on the premise that an existing class can be re-used in the future by means of derivation. Therefore, examining the actual type of

Simulating Inheritance of Assignment Operator

As opposed to base class’ constructor and destructor, which are automatically invoked from the derived class’ constructor and destructor respectively, a user-defined assignment operator defined in a base class is

<SPAN> Attribute in IE

Question: I’ve been working on completely redoing my company’s Web site for over a month and a half now. To help me out, I bought a book on HTML 4.0

C vs C++

Question: What is the main difference between Visual C and Visual C++ in Windows environments? Why would I want to use C++ instead? Is there any functional difference? Answer: Well,

Closing an application

Question: When I press the Close button on my app’s main form, the program appears to end. When I look at the Windows task list, however, my app is still

Saving Object to File

Question: Is it possible to save an object (in my case a collection) directly to a file, or must one extract the object’s properties and save each individually? Answer: Visual

Java interfaces and constructors

Question: Is there a way to force a specific constructor with an interface? Answer: No, there is no way to force implementors of a given interface to use constructors with

Java and Dual Monitor Unix Workstations

Question: I have a question regarding use of dual monitorUnix workstations to display Java screens.Specifically, can I display the mainscreen on onemonitor and the popup on another monitor? Answer: Within

InetAddress to String

Question: Is it possible to convert from java.net.InetAddress to string? Answer: Yes. Just call the InetAddress toString() method. Also, if you specifically want the host name, use getHostName. If you

Approach to studying C++

Question: My development background primarily involves COBOL and BASIC on UNIX platforms. I decided to further my language knowledge and branched out into C & C++. I’ve largely been teaching

Exception to String

Question: Given an exception, how do I convert the stack trace into a string? I want to capture the entire contents, the message and the trace, to a string. Answer:

Mandatory exception handling

Question: Why should some of the statements that might throw an exception be in try/catch block (otherwise the compiler reports a syntax error), and some need not be, even though

Dynamic memory allocation

Question: How do you dynamically allocate memory for a two-dimensional array? This is what I had, and my g++ compiler didn’t like it: int **m;m= new int [100][100]; Answer: Yep.

Closing an application from another app

Question: How do I use one application to close another application in Windows 95? I need to overwrite a loaded DLL, so I have to close the application that loads

Recursion

Question: Is it possible to make recursive subroutine calls in Java? Answer: Yes, you can make recursive method calls in Java.Just make sure you have a termination condition to avoid

C/C++ system() equivalent

Question: Does Java have a command that does what thesystem() function does in C, or a way to emulatethis action? For example, in C, system(“ls”); would call “ls” from the

Converting text to a binary code

Question: I’m using Borland C++ to perform some data conversion, and I have had some difficulties. Is it possible to convert all the text (including nonreadable text) within a text

Applets, URLs, and frames

Question: I want my Web page to have three frames: one for my applet and the other two for information. How can I make it so my applet updates both

Windows Programming (custom windows)

Question: I am trying to program my own custom controls in C++ in the old, traditional style (using WNDPROCS, etc.), and I don’t want to use ActiveX. I’d like to

Year 2000 and C++

Question: I am urgently looking for information regarding Year 2000 compliancy for Borland’s C++ compilers, esp. versions 3.1 and 4.02. Answer: I can’t imagine anything about C++ or the compiler

Text Area and Cursor Control

The java.awt.TextComponent class (from which TextArea is derived) has three methods to retrieve mouse selection information. The getSelectedText() method will return a String containing the selected text, and the getSelectionStart()

HTTP Authorization Using Java

Many programmers like to use Java to automate access to network resources because it is so easy to write networking code with the Java networking classes. Accessing URLs through Java

Fetch Contents of URL

The Java core API provides classes in the java.net package to handle basic networking functions. The URL class represents a pointer to a network resource, like the actual address. The

Play WAV Sounds from Resource Files

Everyone loves a good sound bite. You can use the PlaySound() function in the Windows Multimedia DLL (WINMM.DLL) to play a wave (WAV) file that is stored as a resource.