Deadpool
How to make pair of elements in a array and find element with no pair in c++ ? Answer I found about this was using bitwise xor operator but I can't understand how , can someone help me ?
😉
how to return an array and assign to an array in main function
klimi
how to return an array and assign to an array in main function
you usually don't want to copy whole array, you just allocate it, put your values and hand over the array pointer to main
the best for everyone
can anyone tells me what is the problem in this
Rehan
Any one have OOP notes C++
klimi
Which one? I have no record or such action
Mehedi Hasan
Yes I have
Please give me
Anonymous
How can I start learning C++ from beginning
Dima
practice, don’t take courses
klimi
i mean the github and everything is fine... just don't post wall of code...
klimi
it's fine to use pasting services like i have shown above
Anonymous
Hey,i nub in c++ and i spent a some many hours in this question,but i dont answer this. Error LNK2001 unresolved external symbol _memset. code - https://pastebin.com/E7e8W04G
Ludovic 'Archivist'
Hey,i nub in c++ and i spent a some many hours in this question,but i dont answer this. Error LNK2001 unresolved external symbol _memset. code - https://pastebin.com/E7e8W04G
perhaps if you spent less time writing on asses and more time getting acquainted with the basics of how a linker works you would have found out you probably are missing your libc dll
the best for everyone
I have a problem in the creation of linked list this and I just enter a number form the user and it doent continue
Pavel
I think you can do s(this->j[0], 40);
Pavel
You can also use std::distance to find distance between pointers https://en.cppreference.com/w/cpp/iterator/distance
Richard Luo 🐱
Does every container inherit from a common type in c++? If not, how am I supposed to pass any iterable type as a function parameter?
Ludovic 'Archivist'
Ludovic 'Archivist'
In my work I use something similar to that with a bunch of concepts that work like C# Linq
Pavel
Cpp2 here we go https://www.youtube.com/watch?v=ELeZAKCN4tY
Pavel
Anyone who got somewhat familiar with Carbon, how different this is to what Carbon proposes?
Anónimo
#paste
Anónimo
Hello, I'm learning C++ at the university, and I need help with this code. When I run it, it shows me 2 errors: 'add' was not declared in this scope and 'substract' was not declared in this scope. Maybe you will find it something stupid, but for me it's quite difficult. https://hastebin.com/nowayovige.cpp
Anónimo
thanks in advance
Puspam
i aspirant Don't message or even call anyone without permission. These are the basic ethics.
Sleeves
https://hastebin.com/povegefizu.cpp
Sleeves
https://hastebin.com/povegefizu.cpp
can anyon explain what happens in nibble = array[i] -‘A’ + 10;
Sleeves
The program is supposed to convert hexadecimal digits into decimal digits
Anonymous
hi is there anyone interesting in c project
Anonymous
i mange to get a c test with its solution
Anonymous
its a test from the school 1337 in morocco
Anonymous
its the same as schools 42 in all around the world
Anonymous
i did understand some part of it
Sleeves
maybe you should message me about this and not clog up the channel
Anonymous
but most of it was new to me even i have finish a lot of tutorial about c and c++ and i can write function with gui
Anonymous
ok xD
Sleeves
can anyon explain what happens in nibble = array[i] -‘A’ + 10;
why does it add 10 to it in the conversion. That is what i do not understand
Captain
If you encounter any alphabet it will convert it to integer and then add 10 to it
Sleeves
Because A=10,B=11 so on in hexadecimal
yes but that doesnt make a lot of sense
Sleeves
10 is hardcoded into the program
Sleeves
and not dynamic
Captain
yes but that doesnt make a lot of sense
Refer to ascii table you'll get the idea
Sleeves
ok i will take a look
Sleeves
Refer to ascii table you'll get the idea
can I dm you? It’s doesnt add up.
3xploit
Hello i have a program that when i compile it using x86 it works fine but when i use x64 i figure out that it has different results , i hope it's ok for mention it here. I need to know what is going on cause first time i see this. More specific , the char buffer have different results. I will do some more test later using different compilers and IDEs.
모하마드
can I dm you? It’s doesnt add up.
If you have given hexa number like hexa_number = 'F' then you want to convert into decimal using formula hexa_number - 'A' + 10 F in decimal format is 15 and in ascii code is 70 - ascii code of 'A' is 65 in hex code 'A' is 10 So then : result = 70 - 65 = 5 + 10 = 15; That is mean that decimal format from hex format 'F' is 15
Anonymous
What format specifier in C can be used to print out the following: "RAM0"
christian
%c
Hussein
Hi I'm trying to make my own database system from scratch, so I'm wondering how my b-tree should be mapped on the disk and how can I optimise it according to it's block size
Aurora
Hi guys
Aurora
[ 40%] Linking CXX executable main /usr/bin/ld: CMakeFiles/main.dir/main.cpp.o: in function `main': main.cpp:(.text+0x20): undefined reference to `EventTranslator::EventTranslator()' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/main.dir/build.make:97:main] 错误 1 make[1]: *** [CMakeFiles/Makefile2:100:CMakeFiles/main.dir/all] 错误 2 make: *** [Makefile:91:all] 错误 2 aurora@aurora-XiaoMai-Series:~/Source/linuxevent$ ^C aurora@aurora-XiaoMai-Series:~/Source/linuxevent$
Aurora
why
Aurora
# event cmake # Sets the minimum version of CMake required to build the native library. cmake_minimum_required(VERSION 3.18.1) # Declares and names the project. project("event_proxy") set (header) set (source) list (APPEND header Devices.h EventTranslator.h) list (APPEND source Devices.cpp EventTranslator.cpp) #aux_source_directory(. DIRS) set (all_files ${header} ${source}) add_library(event_proxy SHARED ${all_files})
Aurora
root:
Aurora
cmake_minimum_required(VERSION 3.18.1) project("main") add_subdirectory(event) add_executable( main main.cpp ) target_include_directories(event_proxy PUBLIC event)
Anonymous
cmake_minimum_required(VERSION 3.18.1) project("main") add_subdirectory(event) add_executable( main main.cpp ) target_include_directories(event_proxy PUBLIC event)
According to your cmake list files, the target main depends only on main.cpp. You have not added event_proxy as dependency for the target main. That is what is giving you the linker error Use target_link_library command to add event_proxy target as a dependency for main. PS - Your cmake files suck. No offence. But please go through Modern CMake guidelines to understand what you need to do to make it better
Anonymous
Hi I'm trying to make my own database system from scratch, so I'm wondering how my b-tree should be mapped on the disk and how can I optimise it according to it's block size
http://web.archive.org/web/20161221112438/http://www.toadworld.com/platforms/oracle/w/wiki/11001.oracle-b-tree-index-from-the-concept-to-internals An article on how Oracle implemented B-Trees. But remember that Oracle databases in production usually run on a bare metal system where Oracle acts as the OS and takes over hard disk accesses and knows how to tailor itto better fit the access patterns. This is not possible if you do it on a system with an intermediate OS as you have to go through the OS everytime. But the linked article should give you a good idea of how it is done.
ʙʀʜᴏᴏᴍ ⑇
when I declaring an array ... what is the last index stands for!? for example : int arr[2]; arr[0] = 5; arr[1] = 3; Now what is in arr[2] that's not allowed me to put any value else?!
Pavel
I mean, arr[2] was it something like int arr[2]; ?
christian
when I declaring an array ... what is the last index stands for!? for example : int arr[2]; arr[0] = 5; arr[1] = 3; Now what is in arr[2] that's not allowed me to put any value else?!
You can't put anything in arr[2] because the location does not exist. When an array is declared as arr[2], it means that it is an array of size 2, meaning that there can only be 2 elements of that array, which will be arr[0] and arr[1].
christian
I remember that I reed that the last index is stands for NULL , so RAM can easily know where is the array ends , so is this true or what!?
If what I'm reading is correct, then this is usually applicable for an array of characters. There has to be a terminating character ('\0') at the end. When you declare it as char str[] you have to add it manually, but when you declare it as char *str it's added automatically. Someone correct me if I'm wrong
Pavel
I remember that I reed that the last index is stands for NULL , so RAM can easily know where is the array ends , so is this true or what!?
As Blekhi mentioned this is true only for c-strings (which are null-terminated arrays of chars), also in case of c-string the array size is one element bigger than the string to have a space for that zero char. Other arrays and other types of strings may not have that.
Pavel
Also for array of numbers it doesn't make sense at all, because 0 is a valid number