C++ Define Matrix

This is a discussion on C++ Define Matrix within the C++ Programming forums, part of the General Programming Boards category; Hey ; ) I must use the logic of object-oriented programming. How can i define a [3x3] matrix with use ...

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    3

    Cool C++ Define Matrix

    Hey ; )

    I must use the logic of object-oriented programming.
    How can i define a [3x3] matrix with use Class?

    Can you give me advices or some examples? , thank you ; )

    I am sorry, my english is not good so much. : p

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,781
    What have you tried?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Dec 2011
    Posts
    3
    #include<iostream>
    #include<conio.h>
    using namespace std;

    class matrix
    {

    public:
    int a[3][3];

    Can it be a matrix define with class?

    I want to addition and multiplication calculation with use class ? I will use for it overloading technique. ; )

  4. #4
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,635
    Use code tags when posting code.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Dec 2011
    Posts
    3
    Code:
    #include<iostream>
    #include<conio.h>
    using namespace std;
     
    class matrix
    {
     
        public:
        int a[3][3];

  6. #6
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    First, you do not want to use using's in a header. Second, what is your problem with the implementation you posted?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. adjacency matrix and sparse matrix
    By dpp in forum C Programming
    Replies: 3
    Last Post: 07-11-2010, 10:26 AM
  2. difference between #define and #define ()
    By bored_guy in forum C Programming
    Replies: 8
    Last Post: 07-20-2009, 06:58 PM
  3. Need help in Matrix Addition & finding Inverse of a Matrix
    By ssatyan.129 in forum C Programming
    Replies: 6
    Last Post: 05-15-2009, 02:48 PM
  4. Replies: 1
    Last Post: 02-28-2008, 12:30 PM
  5. Matrix: Reloaded + Enter The Matrix (the game)
    By LuckY in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 04-18-2003, 12:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21