Message from C, C++ talks

October 2020

— Can you show 🤔

— Https://godbolt.org/z/ndMT4o

— It's really not. He's referring to the solution I've sent him, which solves the entire problem he wants to solve

Message permanent page

— But he wants Python-like usage of lines, or something

— 

#include <vector>
#include <string>
#include <iostream>

using std::vector;
using std::string;
using std::cout;

int main (void)
{
//std::string s = "452 5024 0422";
std::string s;
std::getline (std::cin, s);

std::string delimiter = " ";

vector<int> numbers;
size_t pos = 0;
std::string token;
int aux;
while ((pos = s.find(delimiter)) != std::string::npos) {
token = s.substr(0, pos);
aux = std::stoi(token);
numbers.push_back(aux);
s.erase(0, pos + delimiter.length());
}
aux = std::stoi(s);
numbers.push_back(aux);

std::cout << "The numbers are: " << '\n';
for (int number : numbers)
std::cout << number << '\n';

return 0;
}

— My concern is the size of the binary compiled by the programming language.

I will try to figure out the speed later when i really learn how to program.

Also, apart from the program fitting on a floppy disk, I want it to be a videogame. That's why I want to learn programming.

Also, Unity is bloated. My computer has 2 GB of RAM and 1.10 GHz of processing power, yet for some reason it's 64-bit.

Message permanent page

— Check TCC (Tiny C Compiler) for a compiler that produces tiny binaries

— The binaries are much smaller than the ones produced by GCC/Clang

— And can get even smaller after stripped

— Don't

— Stripped binaries are small as they are. It's game assets that are a problem to fit on a floppy.

— Well, but that's not the kind of thing where ASM helps

— Which?

— Don't get libre Linux

— Asm helps to get that extra oomph of processing power. But you must really badly lack one