сумбула
Guys, is "c++ Primary" nice book to read?
Hu la la la
Pls stop talking
сумбула
yes
Have you read it?
Lion
i have
YUSUF
i just started open cv with visual studio i downloaded opencv 4.5.2.my windows is x64.i followed by all the given below steps I ran the following code: #include<opencv2/imgcodecs.hpp> #include<opencv2/highgui.hpp> #include<opencv2/imgproc.hpp> #include<iostream> using namespace std; using namespace cv; string path = "ress/IMG_20200725_173121.jpg"; Mat img = imread(path); int main() { imshow("img", img); waitKey(1); return 0; } but still i am facing some problem: With some negative exceptions at 0x00007FFCB29F4B59 in opencv.exe: Microsoft C++ exception: cv::Exception at memory location 0x000000AB2B4FF730. i dont know what should I do as i am beginner in visual studio.
сумбула
i have
Okay, thanks
Ade
Thank you
labyrinth
i had come across several notation of ptr == (void*) -1 in which ptr is of type void*, but I cannot find the meaning of casting -1 to void* online, and it seems that it is not the same as NULL / nullptr in c++
Hi
https://golashboy.blogspot.com/2021/04/tail-recursion-in-python-by-golashboy.html
Oleg
how to post links here?(
Anonymous
how to post links here?(
for what reason, other than the link for your code?
Oleg
to show the answer on the question above. I've found it on stackoverflow
Oleg
it seems not
Marián
Anyone using CMake? How do i link .cpp files? I’ve done link_directories and add_executable but it doesn’t work, keeps yelling ld symbol not found 😕
[Gaal wase bilaa cashuur ]?_ 2 grals
Yes
Marián
doesn’t work 😕
[Gaal wase bilaa cashuur ]?_ 2 grals
😞
Marián
https://ctrlv.cz/shots/2021/04/23/9qJX.png
Oleg
file (GLOB_RECURSE SOURCES "*.cpp") add_executable(${PROJECT_NAME} ${SOURCES})
you can write add_subdirectory(src) there, put CMakeLists.txt in src, and write the code above
Oleg
what "how"?
Marián
add_subdirectory(src) file (GLOB_RECURSE SOURCES "*.cpp") add_executable(majdadb main.cpp ${SOURCES}) liek that?
Marián
add_subdirectory merges the subdir into a root, or just registers subdir usage?
Oleg
it searches another CMakeLists.txt in the directory /src
Marián
oh wait why would i do this, i just have some .cpps stored in /src
Oleg
I just do what helps me, I separate searching packages and source files on two different CMakeLists files.
Oleg
does it show any error codes?
[Gaal wase bilaa cashuur ]?_ 2 grals
Okay
Giorgi
Error shows on Imshow function
Have you tred putting string path = "ress/IMG_20200725_173121.jpg"; Mat img = imread(path); in the main before imshow?
[Gaal wase bilaa cashuur ]?_ 2 grals
Yes
Giorgi
Yes
see edited message
Giorgi
Yes
Mat img = imread(path); This should be in main before imshow() method.
Giorgi
Yes
Did you try that?
[Gaal wase bilaa cashuur ]?_ 2 grals
Yes, I did
Hariyana Grande
#include<stdio.h> int main(){ char str[]= "hello"; char *ptr = str; printf("%c", *ptr+1); ptr++; return 0; }
Hariyana Grande
what wrong with *ptr+1 ? while *(ptr+1) is showing correct output
Hariyana Grande
can u explain what *ptr+1 doing ?
Hariyana Grande
it shows "i" in ouput printing alphabets
Nameful
In the first you are dereferencing first then adding and in the second adding then dereferencing
Hariyana Grande
isnt both same thing in context to "hello"
Oleg
*ptr + 1 -> value + 1
Oleg
*(ptr + 1) -> *(reference + 1) -> *(new refernce) -> value under new reference
Ammar
what wrong with *ptr+1 ? while *(ptr+1) is showing correct output
It probably more making sense by explaining it with [] style. So *ptr + 1 is actually ptr[0] + 1 And *(ptr + 1) is actually ptr[1] Does that make sense?
Hariyana Grande
i got what it did bt in first case why its printing alphabets when i did *ptr+17 it prints "y" so my question is why its printing alphabets even tho we only assing a variable str which allocates memory for 4characters
Hariyana Grande
yes
Anonymous
What is data structures . I am a newbie
Oleg
what is char?
Hariyana Grande
i know my question sounds silly but ah i wish i could explain what excatly i wants to say
Anonymous
What is data structures . I am a newbie
https://en.wikipedia.org/wiki/Data_structure
Anonymous
sometimes it's better to just google things
Hariyana Grande
what is char?
charachter store in one byte of memory
Anonymous
Best language to learn data structures
Anonymous
Best language to learn data structures
you don't need a lang. pseudo-code is good enough
Nameful
charachter store in one byte of memory
Legends say there are architecture where char is 2 bytes
Hariyana Grande
yes
Anonymous
Legends say there are architecture where char is 2 bytes
its true, the size of any variable is architecture dependent. you do know that it'll be at least 1 byte tho
Oleg
charachter store in one byte of memory
right. char is integer type which could work like int, long int etc. you can sum, sub or mul it. whatever.
Hariyana Grande
yes
Oleg
true. so you can do something like 'a' + '1' or 'a' + 1
Hariyana Grande
so here "1" depends on architectre prints 1 or two byte ahead
Hariyana Grande
like b
Hariyana Grande
or it deepends on comppiler different output for different compiler
Oleg
no, I didn't talk about pointers, bytes or addresses. when you write *ptr + 17 you mean "Take the value under ptr and add 17"
Oleg
but
Oleg
when you write *(ptr + 17), you mean take the address, add 17 bytes (or 2 * 17 bytes as said above) and give me the char number under the address