Author Topic: Preprocessor. Array  (Read 7699 times)

Offline AntonPotapov

  • Jr. Member
  • *
  • Posts: 13
Preprocessor. Array
« on: April 24, 2023, 01:34:07 PM »
How to use a string as an array in the preprocessor?
For example I have a string:
Code: [Select]
%define string "Hello World"
how do i get e.g. 'W' ?
Does the preprocessor have arrays?
I want to get a string character similar to C:
Code: [Select]
char *str = "Hello World";
char ch = str[6]; // just like that

I recently started learning assembler, literally half a week ago. I read the documentation: https://www.nasm.us/xdoc/2.16.01/html/nasmdoc4.html.
I found operators like substr, which should be enough for my purposes. But I want to understand the preprocessor more thoroughly.
« Last Edit: April 24, 2023, 01:43:24 PM by AntonPotapov »