#include <iostream>
int main()
{
int num = 342;
std::cout<<"num = "<<num<<"\n";
std::cout<<"address of num is at &num = "<< &num<<"\n";
return 0;
}
num = 342
address of num is at &num = 0x7ffd2a738f6c
#include <iostream>
int main()
{
int num = 32;
int * pointerTonum = #
std::cout<<"pointerTonum stores the address of num as"<< pointerTonum<<endl;
std::cout<<"the address of PointerTonum stores the value of num as<< *pointerTonum<<endl;
}
class ENGINE_API USphereComponent : public UShapeComponent
{
// code
}
#include <iostream>
using namespace std;
class printNum{
public:
void print(int i){
cout<<"print integer: "<< i <<endl;
}
void print(double f){
cout<<"print float: "<< f <<endl;
}
void print(char*c){
cout<<"print character: "<< c <<endl;
}
}
int main()
{
printNum pn;
// print integer
pn.print(23);
// print float
pn.print(234.23);
// print character
pn.print("hello C++");
return 0;
}
void AFPSObjectiveActor::NotifyActorBeginOverlap(AActor* OtherActor)
{
Super::NotifyActorBeginOverlap(OtherActor);
PlayEffects();
AFPSCharacter* MyCharacter = Cast<AFPSCharacter>(OtherActor);
if (MyCharacter)
{
MyCharacter->bIsCarryingObjective = true;
}
}
class UBoxComponent; // forward declaration
class FPSGAME_API AFPSExtractionZone : Public AActor
{
protected:
UBoxComponent* OverlapComp;
}
#include <iostream>
using namespace std;
int main()
{
float f = 5.4;
int a = static_cast<int>(f);
cout <<a;
}