ChaosPad V1.1
Full screen

Server Notice:

hide

Public Pad Latest text of pad cpp-snake Saved April 25, 2024

 
CPP-Snake
 
 
#include <bits/stdc++.h>
using namespace std;
 
void log(string str, Api* api){
    api->log(str.c_str());
}
bool step(Api* api) {
    api->log(string("Hello C-String World"));
    string str="Debug Value1: ";
    str+= 3 + ", some more text";
    log(string("some string") + 5.1);
    log(string()+3);
}
 
ich mache das:
string logtxt = "bla" + to_string(irgendeine integer variable);
api->log(logtxt.c_str());
 
 
int main(){
    vector<int> vec(10,20);
    
    vec.push_back(200);
}
 
 
 
 
 
/* C-Arrays: Legacy DO NOT USE */
int main(){
   int some_array[23] = {5,2,3}; 
    some_array[103];
    *(some_array + 3)
    return 0;
}
 
void caller(){
    int a = 23;
    call_by_value(a);
    call_by_adress(&a);
    // a is now 24
    call_by_reference(a);
    // a is now 25
}
 
void call_by_value(int a){
    a++;
    
    }
 
 
void call_by_adress(int * a){
    (*a)++;
    
    }
 
 
void call_by_reference(int& a){
    a++;
    }
 
 
 
 
 
api.functions_name();
(*api).funktions_name();
api->funktions_name();
 
 
 
 
 
 
 
 
ist das da in Ordnung?
Ich habe so meine Probleme mit Pointer, vectoren in funktionen...
 
 void add(vector<int> *clc, int pos, int add)
{
    (*clc)[pos] += add;
}