Profile cover photo
Profile photo
Sabir Shah
119 followers
119 followers
About
Posts

Post has attachment

Post has attachment
Allocating Memory with malloc
Allocating Memory with  malloc [This section corresponds to parts of K&R Secs. 5.4, 5.6, 6.5, and 7.8.5] A problem with many simple programs, including in particular little teaching programs such as we've been writing so far, is that they tend to use fixed-...
Add a comment...

Post has attachment
Add a comment...

Post has attachment
**
Reading the Command Line We've mentioned several times that a program is rarely useful if it does exactly the same thing every time you run it. Another way of giving a program some variable input to work on is by invoking it with  command line arguments . (...
Add a comment...

Post has attachment
Add a comment...

Post has attachment
Point 3D Java
class Point3d extends Point2d {
private double z;

public Point3d( int px, int py, int pz) {
super (px, py);

z = pz;
}

public Point3d () {
super ();
z = 0;

// perhaps a better method would be to replace the above code with
/...
Add a comment...

Post has attachment

Post has attachment
Divide By Zero Exception in Java
import java.io.*;

// This program shows a stack track that occurs when java
// encounters a terminal error when running a program.

public class DivBy0
{

public static void funct1 ()
{
System.out.println ("Inside funct1()");

funct2();
}

public s...
Add a comment...

Post has attachment
Add a comment...

Post has attachment
My File Reader
import java.io.*;
import java.util.*;

public class MyFileReader
{

public static void main (String[] args) throws java.io.IOException
{

String s1;
String s2;

// set up the buffered reader to read from the keyboard
BufferedReader br = new Buffer...
Add a comment...
Wait while more posts are being loaded