🅸🅼🆁🅰🅽
Microsoft is in a secret program with Windows and GPT to monetize.
codename : KILL PROGRAMMING JOBS
Software engineers usually forget his own code as he never actually wrote it.
So software engineer should not hold any license for their code. Actually software licensing should never happen.
It should always be free.
So AI can easily enable all the people of the world to write software.
Currently software engineers are actually the hindrance of the future.
So AI will replace software engineers for sure.
Ludovic 'Archivist'
An
Hi.
How can I get array elements from+to a specific index.
Like in python, array[from:to]?
The
klimi
𝔖𝔞𝔯𝔬
𝔖𝔞𝔯𝔬
Bu that is the point of coping from an index to an end
AL
hi guys
AL
i have a question,
AL
I'm currently making a shop cashier project, now in it there is a module that can add items. the plan is that the user (admin) will input the items, prices and stocks that are stored in the ListBarang struct variable then stored in a file...
but when running, the program actually stops after the user inputs the stock and the file remains empty... does anyone know how to save it in a file and later it can be accessed again to add or delete per unit item?
Chat Boss
AL sent a code, it has been re-uploaded as a file
AL
this is the code i tried
klimi
An
klimi
oh you wanted to copy... well, if they are copy-able you can just copy them
Guillermo
An array of structures
you can copy an array of data structures with memcpy anyway, just pass the source address, the destination addres and the size (which usually is sizeof(data structure) * number of elements)
Guillermo
let say you have something like this:
struct
{
vec2 position;
Texture *pTexture;
} GameObject;
GameObject actors[100];
GameObject temp[100];
memcpy(temp, actors, sizeof(GameObject) * 100);
Albatross
Hi, I'm having trouble compiling a C++ code in my command prompt. I have installed Microsoft Visual Studio 2022 and added the path to the environment variables. I am running the 'cl hello.cpp' command in the same directory as my source code which is a simple 'Hello World' program. However, I'm encountering the following error: 'hello.cpp(1): fatal error C1034: iostream: no include path set.' I'm not sure why I'm getting this error or how to solve it. Can you please guide me on how to resolve this issue?
Guillermo
Just use the command prompt provided by your Visual Studio IDE
Albatross
how to open that?
Guillermo
Guillermo
Look for it in your windows
Albatross
but bro, I want to compile my code from anywhere in my pc like python how we are compiling like that how to do that here what is the right comment bro
Guillermo
I understand you, but you will need to do more settings apart of adding the path to your environemt variables
klimi
Guillermo
thats why most ppl uses the command prompt provided by your VS 2022
Albatross
this path I add already
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64
klimi
Guillermo
Albatross
Guillermo
i'm ready to do that all
Ok, execute the command I told you before and start copying things from that command line to your environemt variables
Guillermo
I mean, execute the command tool, and type 'set'
Guillermo
and copy everything to your environemt variables
Guillermo
Guillermo
anyway, for linked lists it shouldn't be a problem, but instead of using memcpy, you will need to travel the full array
Albatross
when I work with minGW that time I add only minGW bin folder path it's worked well on that time
Guillermo
do you understand now?
Guillermo
the problem is not the data structure, is the memory allocator
Guillermo
I mean, when you define an array of data structures, all the memory is allocated once afther the other
Guillermo
with memory allocation, you depends on the valure given by malloc()
Guillermo
one trick is to declare one array of some elements with malloc so you can make copies the same way you are doing with datra structures ¿Do you understand?
Guillermo
Something like: LinkedList *GameObjects = LinekdList_Init(100);
Danya🔥
Danya🔥
Specifically CMake
Guillermo
after that, you could use memcpy the same way you are doing with arrays, but be aware that, you can do it just because the memory is allocated for the whole block
Guillermo
yes, that's why I told you to use the command tool provided by VS 2022
Guillermo
you could do the thing Denya told you
Albatross
Guillermo
Albatross
well done!
compile is the first step it's also very verry hard in cpp i'm thinking like this
Albatross
missing minGW exe ahaaaha
Guillermo
well, you can install it on your system
Guillermo
there is cygwin too altought I don't know the difference between both of them
Guillermo
good luck dude!
Anonymous
Anonymous
Windows subsystem for linux
Albatross
nooo I am using windows
Albatross
i think this microsoft visual 2022 can compile cpp code but need to do some other step also like adding more path to environment
Albatross
i install msys2 it's also not well for me bro
Albatross
Hello! If you are using Microsoft Visual Studio 2022 to compile your C++ code, could you please share your process? Specifically, I'm interested in how to compile C++ code from anywhere on the PC using the command prompt, similar to how we run Python code. I would really appreciate any guidance on this matter.