View Single Post
  #1 (permalink)  
Old 08-02-2007, 03:18 PM
HelloWorld's Avatar
HelloWorld HelloWorld is online now
PT Admin
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,118
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Icon13 What's wrong with my structure?

here's the code that I have, it shows me an error, but I've no clue why...

PHP Code:
#include <iostream>
#include <string>
using namespace std;
struct account() {
string name;
int acc_no;
double balance;
};
int main() {
account acc;
acc.name "test";
acc.acc_no 123;
acc.balance 999999;
cout << acc.name << endl;

does anybody have a good explanation of what is structure? why do we want to use it? is it similar with abstract class in java? it seems like it to me... but haven't tried to inherit it...

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote