Monday, April 18, 2011

C/C++ pointer exercise: Pointer Arithmetic

#include <iostream>

int main(int argc, char *argv[])
{
int var_int;
int *pt_int1 = &var_int;
int *pt_int2 = pt_int1 + 1;

int var_short;
int *pt_short1 = &var_short;
int *pt_short2 = pt_short1 + 1;

long var_long ;
long *pt_long1 = &var_long;
long *pt_long2 = pt_long1 + 1;

std::cout << "pt_int1 = " << pt_int1 << "\n";
std::cout << "pt_int2 = " << pt_int2 << "\n";
std::cout << "pt_int2 - pt_int1 = " << pt_int2 - pt_int1 << "\n";
std::cout << "(long)pt_int2 - (long)pt_int1 = " << (long)pt_int2 - (long)pt_int1 << "\n";
std::cout << "sizeof(int) = " << sizeof(int) << "\n";

std::cout << "\n";

std::cout << "pt_short1 = " << pt_short1 << "\n";
std::cout << "pt_short2 = " << pt_short2 << "\n";
std::cout << "pt_short2 - pt_short1 = " << pt_short2 - pt_short1 << "\n";
std::cout << "(long)pt_short2 - (long)pt_short1 = " << (long)pt_short2 - (long)pt_short1 << "\n";
std::cout << "sizeof(short) = " << sizeof(short) << "\n";

std::cout << "\n";

std::cout << "pt_long1 = " << pt_long1 << "\n";
std::cout << "pt_long2 = " << pt_long2 << "\n";
std::cout << "pt_long2 - pt_long1 = " << pt_long2 - pt_long1 << "\n";
std::cout << "(long)pt_long2 - (long)pt_long1 = " << (long)pt_long2 - (long)pt_long1 << "\n";
std::cout << "sizeof(long) = " << sizeof(long) << "\n";

std::cout << "\n";
}


c pointer exercise: Pointer Arithmetic

C/C++ pointer exercise: Pointer Dereferencing

#include <iostream>

int main(int argc, char *argv[])
{
int var1 = 5;
int *pointer = &var1;
int var2 = *pointer;

std::cout << "var1 = " << var1 << "\n";
std::cout << "pointer = " << pointer << "\n";
std::cout << "*pointer = " << *pointer << "\n";
std::cout << "var2 = " << var2 << "\n";

std::cout << "\n";
}


c pointer exercise: Pointer Dereferencing

Friday, April 8, 2011

Qt SDK 1.1 RC released

Qt SDK 1.1 Release Candidate released. This is a major step towards the final Qt SDK 1.1, building on the beta we released a couple of weeks ago. The final Qt SDK will allow you to submit your Qt 4.7 based applications to the Ovi Store.

Summarizing the most important updates compared to the beta:

  • Qt 4.7.3 is included for Desktop and Symbian
  • Update to Qt Mobility 1.1.2
  • Qt Assistant added as separate package (due to developer request)
  • Installer can use system proxy on Linux
  • Notification API moved from experimental to “Additional APIs”
  • Several fixes for the Qt Simulator
  • Several fixes for the installation/updating workflow
You are suggested to read the important article about that Qt 4.7 will not be supported for S60 3rd Edition. Please note that you are still able to create Qt applications for those targets based on Qt 4.6.


Source: Qt Labs Blog - Qt SDK 1.1 RC released