Question about classes
-
Hello everyone, I'm want to build a Gpib drivers for an Agilent instruments. Now...I want it to be a "class a-like" driver , for example if the user wants to set a center frequency of 100MHz in a spectrum driver it will look like this: ... // defenition Agilent_Spectrum spectrum; // initialization spectrum.init(9); // send a frequncy spectrum.frequncy.center.MHz=100; ... The question is : can I do it without using classes ? :rolleyes:
-
Hello everyone, I'm want to build a Gpib drivers for an Agilent instruments. Now...I want it to be a "class a-like" driver , for example if the user wants to set a center frequency of 100MHz in a spectrum driver it will look like this: ... // defenition Agilent_Spectrum spectrum; // initialization spectrum.init(9); // send a frequncy spectrum.frequncy.center.MHz=100; ... The question is : can I do it without using classes ? :rolleyes:
Using just plain
C
you can do whatever you want. It's enough to you, isn't it? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
-
Hello everyone, I'm want to build a Gpib drivers for an Agilent instruments. Now...I want it to be a "class a-like" driver , for example if the user wants to set a center frequency of 100MHz in a spectrum driver it will look like this: ... // defenition Agilent_Spectrum spectrum; // initialization spectrum.init(9); // send a frequncy spectrum.frequncy.center.MHz=100; ... The question is : can I do it without using classes ? :rolleyes:
The answer would be, if you're not using classes, you're probably not using C++/CLI, so you must be asking in the wrong forum.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
The answer would be, if you're not using classes, you're probably not using C++/CLI, so you must be asking in the wrong forum.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
(I do work in c++, and I do know how to use classes...classes is the answer for my problem but it's a lot of work). I didnt say that Im not using classes...I said I want to do it without using classes...meaning: the question is "can I do it in a simple and more primitive way ?" maybe something like "namespace" or structures ? :rolleyes:
-
(I do work in c++, and I do know how to use classes...classes is the answer for my problem but it's a lot of work). I didnt say that Im not using classes...I said I want to do it without using classes...meaning: the question is "can I do it in a simple and more primitive way ?" maybe something like "namespace" or structures ? :rolleyes:
Yes, I can see that you're working in C++, but, again, this is the C++/CLI forum, and you are not using C++/CLI as far as I can see. Of course you can write anything you like without using classes, just like I can walk to the store instead of driving. You are not forced to use the tools that make yuor job easier. Oh, and a struct IS a class, they are the same thing, the only difference is the default access modifier.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )