Sasuke
@Kuldip You should go for the book I mentioned
It's about Algo? Right but I wanna learn C++ 🙄
Anonymous
It's about Algo? Right but I wanna learn C++ 🙄
You learn by implementing things.... The more you implement, the more you learn
Anonymous
And try to cover STL (Geeksforgeeks)... it would make you more fluent
Anonymous
Hello
عزة
Anonymous
Stat c++
Anonymous
Plz stat
Dima
Dima
dir.h?
Dima
/warn This is cxx group, yt link
Anonymous
Hey guys, if anyone.. Please help me out with this.... My task is to find the minimum number of characters at the beginning of a string, so that it becomes pallindrome... I am going with the recursive method. When I am calling the isPallindrome() function inside the min_insert(), it says isPallindrome is not declared in the scope... How do I resolve it???? #include<bits/stdc++.h> using namespace std; bool ispallindrome(string str,int start,int len) { if(start==len) return true; else if(str[start]!=str[len]) return false; else return ispallindrome(str,start+1,len-1); } //start—>starting index of string, len—>length of the string, count—>counter to count the number of characters inserted int min_insert(string str,int start,int len,int count) { if(isPallindrome(str,start,len)) return count; if(str[start]!=str[len]) { str.insert(str.begin()+start,str[len]); count++; } else return min_insert(str,start+1,len-1,count); } int main() { string str; cout<<"Enter the string : "; cin>>str; cout<<min_insert(str,0,str.length(),0); //min_insert(string, starting_index, length_of_the_string, counter) return 0; }
Dima
or use pastebin
Anonymous
wait...
Anonymous
Do I have to download the pastebin file and upload here??
Anonymous
https://pastebin.com/raw/1KqaJ4Af
rex
no not that
rex
what u give the input and u expected from this programme
Anonymous
Input—> abc output—>cbabc So it should return 2 as it is inserting 'c' and 'b' at the beginning
Anonymous
This will give you clarity
rex
ok
rex
i think u cant write isPallindrome inside if statement
rex
because u have defined isPallindrome()
Anonymous
What do I do then??
rex
if returns 1 or 0 then it is ok
rex
but what about last else part in isPallindrome()
Anonymous
If none of the above condition is getting satisfied then it is calling itself again by incrementing the start index by 1 and decrementing the last index by 1
rex
inside if u have to return a int value not a function
rex
it defines no meaning to this
Anonymous
But firstly we need to check wether the string we passed is already pallindrome or not... That's why I am using isPallindrome()
Anonymous
No, it isn't.... But I thought of implementing it using recursive method
Anonymous
I think I'll have to use the other approach to it
rex
why r u tangling urself in this difficult approach
Anonymous
why r u tangling urself in this difficult approach
Idea ticked into the mind..... So thought of implementing it....
rex
ok
Anonymous
Anyway thank you for discussing... 😊
rex
np
Dęvèloper_Nkya 👨‍💻
Thank you 🙏
Dima
welcome
Dęvèloper_Nkya 👨‍💻
Hi everyone.... I'm currently using Turbo C/C++ as my compiler for C codes. Is there a better IDE than this one.
Dima
don’t use neither turbo c or devc++
Dima
use modern ide
Dima
visual studio, clion, qtcreator, codeblocks whatever
Anonymous
don’t use neither turbo c or devc++
What's wrong with devc++??
Dęvèloper_Nkya 👨‍💻
You can use devc++
Ohh... Thank you. Someone told me about Visual code too.
Anonymous
Ohh... Thank you. Someone told me about Visual code too.
I think visual code is for those who know how to deal with terminal (cmd) coz it doesn't contain direct button for compiling code
Dima
you can simply install c++ extension and you’ll get your button to run it
Dęvèloper_Nkya 👨‍💻
In my class.. Visual studio is the one preffered. Followed by Turbo C.
Anonymous
you can simply install c++ extension and you’ll get your button to run it
And what will you do if you have more than 10 files would you compile them one by one using gcc command?
Dima
no
Dima
#googleit
Anonymous
no
So that is why I'm preferring ideas otherwise you have to know make files
Dima
I am telling you can setup a script once to compile everything
Dima
but that’s how what everyone would decide
Anonymous
How can we calculate the integration and differentiation in C ++
Francisco
Francisco
C++ doesn't work like MATLAB or Maxima at all
Francisco
What you can implement is numerical methods to do that, but it isn't an easy task
Anonymous
Thanks for u
Dęvèloper_Nkya 👨‍💻
Has any one ever thought of making a simple or complex game in c/c++
klimi
yes
Anonymous
Give me tips how to study and see the output without a computer ?
klimi
see output without computer?
klimi
so you are programming a computer, without computer?
Anonymous
see output without computer?
Yes, when an exam is on paper
klimi
oh this stuff,,,
Dęvèloper_Nkya 👨‍💻
Give me tips how to study and see the output without a computer ?
I think you have to imagine and question yourself like a computer . A computer checks for errors.. So better double check your answer incase of any errors.
Anonymous
Like this, without the computer
I_Interface
klimi
Like this, without the computer
are you doing the assigment rn?
I_Interface
Then read about arrays and operations with array's elements.
I_Interface
Then read about arrays and operations with array's elements.
How to iterate, get a value, add array's elements etc.