strcmp?
and how would you clear the screen like
clrsrn() or somthin like that?
strcmp?
and how would you clear the screen like
clrsrn() or somthin like that?
strcmp() is a function that takes 2 strings and if they are equal it returns zero. For example:
if(strcmp("Equal","Equal")==0) {
//they are equal
}
Yes, you can clear the screen.
Either you can include conio.h and use clrscr() and hope that you have it in conio or hope that you even have conio or you can make a search on these forums and find one of the custom made clrscr()'s
For an actual calculator program you will need some knowledge of assembly, or at least how your CPU works.
A simple way to implement a calculator would be to use stacks.
For instance one stack calculation might be this
100
ADD
150
-------> Total
which in actual assembly would be
mov ax,64h
add ax,96h
mov [total],ax
you could implement your own push and pop functions
push will push a value onto the stack at stack(0). Before doing this it will move all the contents of the stack down by 1 or down by the appropriate data width.
pop will take the value at stack(0) off and place it in the variable after the pop mneumonic. All contents on the stack are moved up accordingly and the stack size is decremented by the data width of the item taken off of the stack.
You could also implement registers similar to the CPU, but you will only need a subset of what the actual CPU has unless you want your calculator to be robust.
Creating a calculator is very similar to creating an emulator and can get very complex. You are essentially emulating a small CPU inside of the virtual calculator with your CPU.
well i know i have conio... i have visual studio and use microsoft for a c++ compiler and i no they have alot of header files... plus i no i can add more i just dont no how
'strcmp' : undeclared identifier
does strcmp require a certain header file?
with MS VC++ i believe it can be found in string.h and also windows.h'strcmp' : undeclared identifier
does strcmp require a certain header file?
clearing the screen is not part of VC++ but can be found on the FAQ of this board
in the project tab you can add header files to the project then
#include "aHeader.h"
And yes there are a whole lot of header files included with visual studios. If you installed the help files you might want to spend a couple hours going through them like i did once
Hope this stuff helps