Anonymous
clangd will point them out
olli
please consider sharing code instead of pictures of it
PO
clangd will point them out
Clion will correct all idention too?
abhi3700
Hello! Let's say there are 2 functions func1, func2 defined inside a class1. Now while defining func1outside the class, i have to use func2, now should i directly parse func2 or class1.func2 ??
Yes!.. it can be directly parsed like this: - here, inside the address() function defined outside the class, get_num() is used. #include <iostream> using std::string; class home { private: int get_num(){ return 20; } public: void address(string country); }; void home::address(string country = "india") { std::cout << country << "\n"; std::cout << get_num() << "\n"; } int main() { home h; h.address("France"); h.address(); // h.get_num(); // private function can be accessed only from public functions return 0; }
olli
Please
1. It's better not to use VLA, as this is an optional feature 2. your matrix has 3 columns but your loop goes until column * 3 hence you access memory out of bounds and invoke undefined behavior
PO
I'm trying
PO
Nothing change
PO
I must to sum 3 consecutive element of each raw because each 3 element is one px
olli
I must to sum 3 consecutive element of each raw because each 3 element is one px
Why column * 3 tho? If your row contains 3 elements you can't sum up 9 for(unsigned int j = 0; j < column*3; j++){ matrix[i][j] = matrix[i][j] + matrix[i][j+1] + matrix[i][j+2];
PO
C (Red , green , bleu) = each color equal to one element of raw
Patrick
Hello, I'm unsure if this is appropriate to ask on the group, about ncurses. I'm making a terminal REPL, but once it closes its buffer is written over by the shell. How can I prevent this? The real problem I'm trying to solve is getting key presses without pressing enter and ncurses can do that. I used to have a snippet of C code that did it but it isn't restoring my terminal settings anymore.
kky
😳
kky
write(1, "\33[H\33[2J\33[3J", 11)
kky
like this command in the bash: echo "\033[H\033[2J\033[m"
Roshan
Hi
Patrick
run clear ?
Wouldn't clear... completely blank my screen?
Patrick
I want to preserve my ncurses session after my application closes
Anonymous
Is there any STM32F1 freelncer?
Anonymous
@Ranjiith are you know about c??
Chirag
Hey! Can anyone suggest me a book for learning Data structure using C++
Chirag
?
Anonymous
Morning guys would like to know is there anyone who can code on metaeditor like create a robot from a certain indicator
Anonymous
How can i activate clion if im a student?
Wisenky
How can i activate clion if im a student?
Get student licence with your student mail
Anonymous
Get student licence with your student mail
How do they know if im from a college or not?
Wisenky
How do they know if im from a college or not?
They dont but your signature has a limit with graduation year
Anonymous
Oh oke
Anonymous
So then how will i do it?
Wisenky
Just sign up dude
Anonymous
The error message is clear enough
Anonymous
Class tool{ Private: Int a, b; Public: tool(int val, int val2){//here a=val; b=val2; }//to here }; Isnt there a shirt method to assign values using colon like this tool1(int val, int val2): // dont know the rest
Anonymous
Help
Anonymous
tool(int val1, int val2) : a{val1}, b{val2} { }
Anonymous
//header file
Anonymous
#pragma once #include<iostream> #include<ctime> class Date{ private: int day,month,year; public: void init(); void print(); void init(int,int,int); };
Anonymous
//cpp
Anonymous
#include"Date.h" void Date::init(){ struct tm *pointer; time_t timestore; std::time(&timestore); pointer=std::localtime(&timestore); day=pointer->tm_yday; month=pointer->tm_mon; year=pointer->tm_year; } void Date::init(int day,int month,int year){ this->day=day; this->month=month; this->year=year; } void Date::print(){ std::cout<<month<<"-"<<day<<"-"<<year<<std::endl; }
Anonymous
//main
Anonymous
#include<iostream> #include"Date.h" int main(){ Date d; d.init(10,12,2020); d.print(); }
Anonymous
its giving me this error(image uploading) anyone can help what went wrong?
Anonymous
see the error down
Dima
do you have your cpp file added to the pipeline?
Anonymous
what does that mean ?
Dima
it didn’t link that code so it can’t find it
Anonymous
i created .h and .cpp file sperately and included header in cpp
Anonymous
how to connect it then?
Anonymous
in visual studio code i didnt see an option to create a new class so i created a seperate cpp and .h files
Anunay
Not until you share any piece of code
Anunay
And what is the doubt?
Anonymous
/get cbook
klimi
i formatted it for ya
Sameer
Hello guys I'm the beginner in this group can anybody tell me about book from which can I learn from the beginning
Sameer
Nope bro
Sameer
Some one suggested me about this
piggyho
Nope bro
you might want to try that first, these question have had discussions recently. it would be an easy search
Anonymous
Thank u i, ll look it up
FOTTY 76
Hello
klimi
Hello
hi Black
Patrick
(Thanks for the reply but I eventually ditched ncurses as I got my C snippet working)
@unchanted
How and when to use #pragma once And ": :"?
@unchanted
How to know that weather we have to use pragma or ": :"
@unchanted
They are different from each other, right?
@unchanted
@unchanted
the above picture describes how spoaling( simultanious peripherial operations online) works in OS and is considered to have better performance than batch processing... my doubt is, why are we taking input inside the disk and then again sending it to the memory so that CPU can perform the calculation on it, how is it making machine to work faster? why not we just directly send it to the memory management so that CPU can calculate directly?
@unchanted
oh sorry, but i had no other group where i could discuss my doubts so i asked here
@unchanted
Alex
can you explain me this one?
almost always you should use pragma once. however its compiler extension
@unchanted
how does this affect my code?*