Hi,
I am facing weird problem with C++.
With the below example, the print message supposed to be 'Value=22'. But I am seeing it as 'Value=1".
May I know the reason for it please?
FYI, I am using S32DS for ARM C++ Application.
Thanks,
Hari
#include "S32K148.h" /* include peripheral declarations S32K148 */
#include <stdio.h>
class MyClass
{
public:
int a=10;
MyClass()
{
a += 11;
}
};
MyClass myClass;
void func1(void)
{
int x = ++myClass.a;
printf("Value=%d",x);
}
int main()
{
func1();
while(1);
return 0;
}
Solved! Go to Solution.
Hi,
it looks like that there is bug in startup file - thanks for report. You can fix it by adding
bl _start
instead
bl main
in the startupS32K148.S file:
Hope it helps.
Jiri
Thank you Jiri.
That works. Appreciated your quick turnaround.
Best,
Hari
Hi,
it looks like that there is bug in startup file - thanks for report. You can fix it by adding
bl _start
instead
bl main
in the startupS32K148.S file:
Hope it helps.
Jiri