Anonymous
Read the documentation, it is THAT easy
What documentation It's better if anyone explain it I have this doubt for more than 1 year
Anonymous
What documentation It's better if anyone explain it I have this doubt for more than 1 year
No, it's not better To be a good programmer you need to use documentation
Anonymous
https://en.cppreference.com/w/c/string/byte/strcmp
Anonymous
No, it's not better To be a good programmer you need to use documentation
It says Strcmp Compares two null-terminated byte strings lexicographically. The sign of the result is the sign of the difference between the values of the first pair of characters (both interpreted as unsigned char) that differ in the strings being compared. The behavior is undefined if lhs or rhs are not pointers to null-terminated byte strings. What's all of this It's extremely complex for slow learner What's lexicographically
Anonymous
My teacher said that it's special function
Anonymous
My teacher said that it's special function
It's an ordinary function There's nothing special about it
Dima
Anonymous
Pretty much special in turbo c
I didn't get anything what that article was saying About strcmp
Anonymous
Pretty much special in turbo c
Are you an expert in Turbo C now?
Anonymous
I didn't get anything what that article was saying About strcmp
Read about return value It's pretty straight forward
Anonymous
Pretty much special in turbo c
I have to ask someone else I only get that it took their differences alphabetically in same order But what happens I didn't get
Anonymous
Dude, let me rephrase the documentation: If first argument is "less" than second one, the function returns negative value If they are equal, strcmp returns 0 Otherwise it returns positive value
Anonymous
It compares them alphabetically in same order Can you give an example In which it was positive or negative
Think it yourself Google "aphabetically" It's pretty obvious
Anonymous
Just try it yourself
Anonymous
Anonymous
Explore the world
Anonymous
Can anyone give example of that (strcmp character comparison)
Anonymous
Can anyone give example of that (strcmp character comparison)
"abb" and "abc" "abc" and "abc" "abc" and "abd"
Anonymous
"abb" and "abc" "abc" and "abc" "abc" and "abd"
First one is -ve Because last b is smaller than c And third one is Also -ve Right
Anonymous
What is "-ve"?
Anonymous
"abc" and "abb"
Anonymous
"abc" and "abb"
This difference is +ve As said If lhs is abc and rhs is abb
Anonymous
Yes
Anonymous
Thanks
Anonymous
Is it a question?
Anonymous
Is it a question?
I just asked If you don't mind
Anonymous
No, it's just a website with a good documentation It's not meant to be used for learning purpose
Anonymous
It's just documentation
Anonymous
Okay thank you
Anonymous
Yes
This means it can be used to even check which string size is bigger and which is small Usually In most of textbooks and websites I have saw it's use in form of equality test for strings
klimi
Welcome Sumit! Please read the rules!
Anonymous
how do you create a pointer for array of arrays in C
klimi
*
klimi
** something idk
Anonymous
I thought you were a bot
klimi
I thought you were a bot
Nice you are the second one who told me that
Anonymous
** something idk
if you are gonna be sarcastic just ignore the question
Anonymous
i rather silence
klimi
Its literary the answer
Anonymous
Its literary the answer
https://www.dyclassroom.com/c/c-pointers-and-two-dimensional-array
Anonymous
?
some material i found on google but the examples are for ints
Anonymous
i trying to work with character arrays
Anonymous
#include <stdio.h> #include <string.h> int main(){ char track[][80] = { "Digital Dash", "Cold Winter", "Cruel Summer", "The Cool", "twenty two 2s", }; char *pointIt; pointIt = &track; printf("Length of string c = %d \n", strlen(pointIt)); return 0; }
Anonymous
something like this
Anonymous
Its literary the answer
thats not the answer
Anonymous
I really can't tell what you're looking for if not char (*p)[][80] = track;
Ali
Hello, im new to computer science
Ali
Hopefully u guys could guide about it☺️☺️☺️
数学の恋人
Abhi
How first c compiler is created
Anonymous
I have honer 8x phone with android 9.0.1 can any one say how can I root it?
Anonymous
Method one void customConfig(std::string const& section, std::string const& entry) { std::cout << "customConfig function" << section <<","<<entry<< std::endl; } Method two template <typename T> T customConfig(std::string const& section, std::string const& entry) { std::cout << "customConfig function" << section <<","<<entry<< std::endl; int a = 10; return a; } main() { customConfig("Type", "ServiceType"); system("pause"); }
Anonymous
Why method two wrong?
Pete
I have a question guys
Pete
If I’m asked to reverse a sorted list
Pete
Can I just reverse the output? Or probably nah
Anonymous
how do you create a pointer for array of arrays in C
I'm not sure that there's such type in C, but try this: int arr[10]; int (*pointer)[10] = &arr;
olli
If I’m asked to reverse a sorted list
Depends. That's probably not the ideal solution. If youre asking this question in an interview, I would not accept your answer.
Anonymous
And the compiler can't deduce it
Muhtasim Adil
Does anyone do competitive programming here? Can I get your cf- handle?
Pete
Depends. That's probably not the ideal solution. If youre asking this question in an interview, I would not accept your answer.
I have two solutions now properly. Can I just comment one out and tell the TA to test whichever they like?
Sachin
Sachin Bhandari: #include<bits/stdc++.h> using namespace std; template<class T> class graph{ map<T,list<T> > adjlist; public: void insert(T v,T u,bool bidir=true){ adjlist[v].push_back(u); if(bidir) adjlist[u].push_back(v); } void print(){ for(auto node:adjlist) { cout<<node<<"->"; for(auto neighbour:adjlist[node]) cout<<neighbour; cout<<endl; } } }; int main(){ graph <string,int> g; g.insert("Alc","Blc"); g.insert(1,"Blc"); g.insert("Alc",43); g.insert("Almora","Bunic"); g.insert(43,"hello"); g.insert("Almora","Blc"); g.insert("Almora","hello"); return 0; } I want to make nodes of integer and string type so i created a templated class ,but now how to create object of such type?? #help please
Artöm
Creating is easy, provide all necessary template args
Sachin