I use Arch
🤝
🤝 )
Nessie
i get this errror unresolved external symbol _luaL_openlibs referenced in function "private: bool __thiscall MULua::Create(void)" (?Create@MULua@@AAE_NXZ) my cpp and h Cpp: #include "stdafx.h" #include "MuLua.h" #include "GameMain.h" #include "logproc.h" MULua g_MuLuaQuestExp; int MuRequire(lua_State* state); MULua::MULua(void) : m_luaState(NULL) { this->Create(); } bool MULua::Create() { //m_luaState = luaL_newstate(); luaL_openlibs(m_luaState); ////lua_pushcclosure(m_luaState, MuRequire, 0); //lua_setfield(m_luaState, LUA_GLOBALSINDEX, "murequire"); ///lua_gc(m_luaState, LUA_GCCOLLECT, 0); return true; } MULua::~MULua(void) { //Release(); } My .h // ------------------------------ // Decompiled by Hybrid // 1.01.00 // ------------------------------ #pragma once #ifdef _WIN64 #include "../Lua/x64/include/lua.hpp" #else #include "../Lua/include/lua.hpp" #endif class MULua { public: MULua(void); ~MULua(void); private: bool Create(); public: void Release(); bool DoFile(const char* szFileName); bool DoFile(lua_State* L, const char* szFileName); bool DoString(std::string kString); lua_State* GetLua(); void Register(void* pLua); #if (DEBUG_WIN_CONSOLE == 1) void CreateWinConsole(HINSTANCE hInstance); void DestroyWinConsole(); #endif private: lua_State* m_luaState; }; extern MULua g_MuLuaQuestExp; Anyone can help ?
\Device\NUL
Rip question Compiler🇮🇷
Compiler🇮🇷
Where is the error in this code?
Dima
Read the rules or at least try to solve it yourself and show us your code, then we'll help, we won't write the whole for you
\Device\NUL
Where is the error in this code?
Your message got purge lol
Compiler🇮🇷
Abhishek
In CMake, how do I execute a custom command regardless of code changes? (I am trying to copy a folder after build. I want to execute the command after changes were made to that folder's contents as well)
Compiler🇮🇷
Can i send code?
Dima
ye
Compiler🇮🇷
unsigned len(const char* s) s =new char[const]; unsigned z; cout<<"please enter const char:"<<endl; for (int i=1; i<const; i++) cin<<s; if (s !='\0'); ++s; else break; z=s; return z; #include <iostream.h> int main() { char* s; cout<<"len(s)= "<<len(s)<<endl; return 0; } using len(const char* s unsigned len(const char* s) s =new char[const]; unsigned z; cout<<"please enter const char:"<<endl; for (int i=1; i<const; i++) cin<<s; if (s !='\0'); ++s; else break; z=s; return z; #include <iostream.h> int main() { char* s; cout<<"len(s)= "<<len(s)<<endl; return 0; }
Talula
Can i send code?
Use if possible. https://pastbin.com
Compiler🇮🇷
Use if possible. https://pastbin.com
unsigned len(const char* s) s =new char[const]; unsigned z; cout<<"please enter const char:"<<endl; for (int i=1; i<const; i++) cin<<s; if (s !='\0'); ++s; else break; z=s; return z; #include <iostream.h> int main() { char* s; cout<<"len(s)= "<<len(s)<<endl; return 0; }
Abhishek
https://cmake.org/cmake/help/v3.22/command/add_custom_command.html
I know how the command works. What I was asking was to somehow bypass the target dependency or using some other way execute the command every time I build regardless of code changes.
Compiler🇮🇷
Compiler🇮🇷
Abhishek
afaik pre_build always executed. cmiiw
I am trying to execute a command at post build
Suka
I am trying to execute a command at post build
oooo ic. perhaps in pre_build use command to remove generated target?
Abhishek
afaik pre_build always executed. cmiiw
Pre build also depends on target. My target is not changing, I just want to execute the command when I call build.
Compiler🇮🇷
What are you trying to do?
Write the following function code. This function counts the number of bytes in s until s points to the character '0 \ 'using len (const char s);
Abhishek
oooo ic. perhaps in pre_build use command to remove generated target?
That will cause a full rebuild... I just want to execute the command from CMake.
Compiler🇮🇷
Like strlen() do ?
using len(const char* s);
Suka
That will cause a full rebuild... I just want to execute the command from CMake.
check this out: If DEPENDS is not specified, the command will run whenever the OUTPUT is missing; if the command does not actually create the OUTPUT, the rule will always run.
\Device\NUL
using len(const char* s);
size_t len(const char *s) { size_t i; for (i = 0; s[i] != '\0'; i++); // or *s++ return i; }
Stay Forward
/getcbook
Abhishek
check this out: If DEPENDS is not specified, the command will run whenever the OUTPUT is missing; if the command does not actually create the OUTPUT, the rule will always run.
This is talking about how if the depends is not specified, the build target changes will always trigger it. This is dependent on target execution.
\Device\NUL
size_t len(const char *s) { size_t i; for (i = 0; s[i] != '\0'; i++); // or *s++ return i; }
use size_t data type, it should be enought to hold data size from anything
Talula
Write the following function code. This function counts the number of bytes in s until s points to the character '0 \ 'using len (const char s);
#include <iostream> using namespace std; int main() { char a[100]; cout<<"Enter the string:"; cin>>a; int i = 0; while (a[i] != '\0') i++; cout<<"String Lenght :"<<i<<endl; }
Compiler🇮🇷
Is there a c++ channel or training site for a beginner ?
Strife
YouTube
What do you think about https://www.learncpp.com/ ?
Talula
What do you think about https://www.learncpp.com/ ?
No idea, I learned it from a book back in 1999.
Compiler🇮🇷
YouTube
Thank you
Prince Of Persia
Is there a c++ channel or training site for a beginner ?
Hi bro I suggest you to read books That's really better than any other way to learn a new language Btw if you are tired of books, you can use faradars.org (not free but it teaches good) or as others said YouTube.com (if you have no problem with En)
Prince Of Persia
/report
Roxifλsz 🇱🇹
/ban fake autism software available for scam ad loading
Nana
Does any one know c++ QT graphic programming?
LevelCTZ
Can c++ make a good android application?
klimi
sure
LevelCTZ
sure
Is there any interface that is good than RAD
Anonymous
Help! I'm having some difficulty in an array exercise: Make a program that reads a vector with 5 position and check if there are equal values and white them on the screen. // Input 2,2,4,1,4 // output 2 and 4. My program is showing the following : 2, 2, 4, 4 I don't know why. My code https://github.com/Leumim2020/ExerciciosDeCplusplus/blob/main/vetor14.cpp
Anonymous
Help! I'm having some difficulty in an array exercise: Make a program that reads a vector with 5 position and check if there are equal values and white them on the screen. // Input 2,2,4,1,4 // output 2 and 4. My program is showing the following : 2, 2, 4, 4 I don't know why. My code https://github.com/Leumim2020/ExerciciosDeCplusplus/blob/main/vetor14.cpp
\Device\NUL
It should be iterating from index 0 and check if other index has same value for (size_t i = 0, id = 0; sz = sizeof(arr); i < sz; i++) { for (size_t j = i + 1; j < sz; j++) { if(arr[i] == arr[j]) { eq[id++] = arr[i]; break; } } }
Coffee
I need help guys, the statement " typedef int (*_IO_overflow_t) (FILE *, int); " caused an error "Parameter named '_IO_overflow_t' is missing", and the " typedef " caused "Invalid storage class specifier in function declarator" , what does these errors mean ?
19551A0201_EEE_ABHISHEK
Tnx
Anton
Hi! I’m trying to remove signed bit in 32 bit integer. Does this considered UB? i & ~(1 << 31)
Abhishek
if ( i < 0 ) i *= -1;
Suka
Hi! I’m trying to remove signed bit in 32 bit integer. Does this considered UB? i & ~(1 << 31)
ig that not ub but if you want something like -1 into 1 with your method it will not work because compiler use two complement to represent negative number. why not try use abs function? cmiiw
Anton
ig that not ub but if you want something like -1 into 1 with your method it will not work because compiler use two complement to represent negative number. why not try use abs function? cmiiw
Thanks for the heads up. I was just curious about that particular case, because according to ISO/IEC 9899:1999 — “If the value of the right operand is negative or is greater than or equal to the width of the promoted left operand, the behavior is undefined” in bitwise shift section.
Pritam
Hi
Pavel
What do you think about https://www.learncpp.com/ ?
I've read only the list of topics and looked into a couple of tutorials and it seems that it covers many important things early, which is good.
Strife
My question is to what extent should i learn c++
Abhishek
to that extent, that you stop worrying about learning any other programming labguage.
Abhishek
and develop the confidence that given a problem statement, you can implement it in any programming language of choice.
Pavel
My question is to what extent should i learn c++
With Ue4 you don't need very deep knowledge of C++, you can start without any knowledge of it whatsoever and use unreal blueprints at first (however you need to know basics of programming). Also Ue4 has his own libraries which are replacement of STL basically (standard C++ library), it has garbage collection (which is very uncommon concept for C++ programmers). This means that even knowing C++ you would need to learn UE4 way of using it, and vice versa, learning only C++ in context of UE4 will make you miss some STL knowledge (which is important in general for a C++ developer)
Abhishek
yes, CPP is hard, and need a lot of practice.
Abhishek
but they are wrong when they say you cant do it. If you cant do it, then who will do it.
Abhishek
but learning high level programming languages such as Java/Python/C++ as the first programming language has drawbacks - that you dont get to learn how things work behind the scenes. For example, what if i ask you to implement thread pool by yourself from scratch. Thats the reason one must start with C before attempting C++. High-level languages abstract the inner concepts.
Strife
but they are wrong when they say you cant do it. If you cant do it, then who will do it.
I always ask myself what I want from programming! What do I want to create with a programming language? I get the answer that I want to be a game maker or a programmer in the world of games. But it is a fact that when you choose a language, you have enough mastery of that language