Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
class Stack{
public:
Stack(int size);
~Stack();
void push(unsigned long);
void pop(unsigned long*);
bool IsEmpty();
private:
long * m_stack;
int m_size;
int m_sp; // stackpointer - aktuelle Position im Stack
};
#include <stdio.h>
#include <stdlib.h>
#define MAXSTACK 100
enum type {INT,FLOAT};
struct stacktype{
enum type mytype;
union variante{
int i;
float f;
}value;
} stack[MAXSTACK];
static int top=0;
void push(struct stacktype content){
if (top <= MAXSTACK-1){
top++;
if (content.mytype == INT){
stack[top].value.i = content.value.i;
}else{
stack[top].value.f = content.value.f;
}
}else{
printf("ERROR out of Memory");
}
}
int is_empty(){
if(top == 0){
return(1);
}else{
return(0);
}
}
int main(int argc, char *argv[])
{
push(7);
push(8);
system("PAUSE");
return 0;
}
stacktype x;
x.mytype=INT;
x.value.i = 10;
push(x);
push(int i);
push(float f);
template <typename T> void push(T var);
....
push(x);
j += sprintf(buffer + j,"%d",x);
j+= sprintf(buffer + j,"%f",x);