Original article is from
http://www.gnu.org/software/octave/doc/interpreter/Standalone-Programs.html#Standalone-ProgramsIf you just cope the code from the webpage. You will have a compiler error.
============================================
$ mkoctfile --link-stand-alone main.cc -o main
main.cc: In function 'int main()':
main.cc:13: error: 'row' was not declared in this scope
main.cc:13: error: 'column' was not declared in this scope
============================================
Modify row and column to i and j,
============================================
#include
#include
int
main (void)
{
std::cout << "Hello Octave world!\n";
int n = 2;
Matrix a_matrix = Matrix (n, n);
for (octave_idx_type i = 0; i <>
{
for (octave_idx_type j = 0; j <>
{
a_matrix(i,j) = (i+1)*10 + (j+1);
}
}
std::cout <<>
return 0;
}
============================================
Then you should get the result,
============================================
$ mkoctfile --link-stand-alone hello.cc -o hello
$ ./hello
Hello Octave world!
11 12
21 22
$
============================================
If you have problem to use mkoctfile on Cygwin, you can refer to HERE.
十二星座的時間劃分
魔羯座 (12/22 - 01/19) Capricorn
水瓶座 (01/20 - 02/18) Aquarius
雙鱼座 (02/19 - 03/20) Pisces
牡羊座 (03/21 - 04/20) Aries
金牛座 (04/21 - 05/20) Taurus
雙子座 (05/21 - 06/21) Gemini
巨蟹座 (06/22 - 07/22) Cancer
獅子座 (07/23 - 08/22) Leo
處女座 (08/23 - 09/22) Virgo
天秤座 (09/23 - 10/22) Libra
天蝎座 (10/23 - 11/21) Scorpio
射手座 (11/22 - 12/21) Sagittarius
獅子座 (07/23 - 08/22) Leo
處女座 (08/23 - 09/22) Virgo
天秤座 (09/23 - 10/22) Libra
天蝎座 (10/23 - 11/21) Scorpio
射手座 (11/22 - 12/21) Sagittarius
怎麼記?以終止時間為準,然後以20為單位,所以可改寫成
-1, -2, 0, 0, 0, 1, 2, 2, 2, 2, 1, 1
-1代表20-1,-2代表20-2,然後依序加上月份1,2,3,4,5, ..., 12。
所以就知道第一個星座是1/19結束,所以第二個星座開始是1/20,以此類推。
怎麼記星座順序?
就魔水魚,羊牛子,蟹獅女,秤蝎射。
希望可以一解我老是記不起來的困擾!