сумбула
Guys, is "c++ Primary" nice book to read?
Hu la la la
Pls stop talking
Lion
сумбула
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.
сумбула
Ade
Thank you
Giorgi
Anonymous
Giorgi
yue
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?(
Oleg
to show the answer on the question above. I've found it on stackoverflow
Oleg
Anonymous
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 😕
Oleg
Marián
[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
Marián
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?
YUSUF
YUSUF
[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
Giorgi
Yes
Mat img = imread(path);
This should be in main before imshow() method.
Giorgi
[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
Nameful
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
Oleg
yue
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
Oleg
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
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
Hariyana Grande
yes
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