I know this is alot of code for a Command line calculator but its i only made it to help me understand pointers and classes better.
Type: Posts; User: imortal
I know this is alot of code for a Command line calculator but its i only made it to help me understand pointers and classes better.
EDIT:: Fixed problem with contstructor.
EDIT::: i fixed the problem with the contructor :)
However, cin automaticly moves to the next line after input. Is there a way i can make Cin stay on the same line, so i can use the +, -, *, and /...
Ok, update, scratch that compiler error stuff with the .h. I didnt know that it was written different in C++.
When i delete off the .h, i get compiler errors. Does it really make a difference anyways?
Also, what excactly does "using namespace std;" or whatever it was, do?
Ok, i think i did this right, but it won't compile. Ill post the code and the compiler errors.
#include <iostream>
#include <stdlib.h>
#include <fstream.h>
class workingclass
{
public:
I have to use .h, thats why i do that. Someone esle already told me that above.
jawib: I get like 12 errors when i try to compile that code.
For now this is fine, but i want to learn to create my own constructors and destructors as well. Can someone give me some example code creating a class with just the constructor and destructor?
Ok, so basicly i don't have to worry about adding a constructor and destructor, because the compiler automaticly does that for me?
#include <iostream>
#include <stdlib.h>
#include <fstream.h>
class aclass
{
public:
aclass();
~aclass();
As the subject reads, i'm having a huge amount of trouble understanding classes. The tutorials on this sight are good, but they don't give enough simple examples for me to follow on. What I'm having...
Never mind, i got it :)
Thanks guys.
what do you mean by collective...
No matter what the strings are this program always reads them as different strings...
#include <iostream>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
Can you make this alittle bit more clear for me...im really new to struct, and programming in general..
Here is my code..
#include <iostream>
#include <stdlib.h>
int bill(struct info(int id, int pass));
struct info
{
int id;
Well a while ago i started learning C. Then i toook about a month off from learning anything new, or even using what i already had learnt. I came back the other day to get goin again with it and i...
Ok, thankyou.
I was learning C for a while, then took a couple month break from learning it. Now i want to get back into programming, but i remember so little that im going to just have to start over from the...
Hahaha, omg. Thanks. I completly forgot about input. Ill go add scanf now.
Im learning switch statments and i cant get the output to show up in the counsole. Heres the code..
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int a;
...
where excatly would i put the strcmp in the "if".
the example you gave me looks like its from c++
can you give me an example in plane C?
thanks
Hey, im pretty new and havent been able to get a good book yet so ive been using some tutorials i found on the internet.
well my question is, is there a way to use
a char variable in an "if"....
i c, thanks.