Hi
I know 2 C++ compilers.
- One is Microsoft Visual C++
- the other one is the GCC compiler.
Microsoft Visual C++ comes in different Version with a complex IDE.
Dunno about the GCC C++ compiler.
Basic Syntax:
Ill simply tell you the greatest difference between AHK syntax and C++ syntax.
First:
AHK:
a:=20
if (a=20)
msgbox
C++:
#include <iostream>
using namespace std;
int main ()
{
int a=20;
if (a==20)
cout << "a is 20";
}
- Variables need to have a specific preset type, you define that type before you start using the var.
- You assign expressions in AHK with := in C++ with = only !
- You compare in AHK with = or == in C++ only with == !
- You have to write these ****ing semicolons after every line (except it is an control statement like the if here) !
- C++ is case sensitive !.
- Includes are similar to AHK.
- Ifs have some similarities with AHK ifs.
- Functions also have a specific return type.
- Evey pieces of executed code are inside functions (this time the main function)
AHK:
function(a,b,c)
{
return a*b*c
}
C++:
int function(int a,int b,int c)
{
return a*b*c;
}
Still the type problem.
Now Pointers&Arrays:
a:=[]
Loop,15
a.insert(A_Index)
;or
a:=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
C++
int a[15] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
accessing:
AHK&C++:
a[x] ;
You can find more information here:
http://www.cplusplus...gram_structure/