Hi, thank you for taking the time to take a look at this.

So here's the deal, my assignment is to write a program that resembles the traditional version of bc. It will translate the more common way of writing arithmetic expressions into postfix form used by the dc utility.
Ok, so there is plenty of info how to write a program to convert to postfix notation, therefore thats not the issue. The issue being, I can't find any info on the bc/dc utilities, and can't really figure out how they choose their output, other than testing thousands of entries and expressions over and over. Our teacher simply expects us to be pros at the unix environment without any prior knowledge or lessons.

Examples of input and output, respectively.
1+2*3 -- 1 2 3*+ps
i=+2; -- li 2+si
a=b=c=0 -- 0dscdsbsa

if(x<4) -- [ 2sy ]s0
y=2; -- lx 4>0

Thanks for any help you may provide.
Paul

> The issue being, I can't find any info on the bc/dc utilities

Did you try typing info dc (and/or info bc ) at the command prompt?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.