Neel
Every node maintains a local view of the entire network distributedly e.g. It maintains which neighbouring node is capable to deliver a specific node in the universe. If the nodes are mobile then the routing table of the affected node are also updated. So x simultaneously forward messages for p, q, r and other nodes. There is no hierarchy.
Anonymous
/get cbook
𝚕𝚊𝚒𝚗𝚋𝚘𝚝.𝚜𝚌𝚖 🇺🇬
/get
NAM3L3SS
/get c++book
Anonymous
/get c++book
/get cppbookguide
NAM3L3SS
Anonymous
I agree with rules
Anonymous
Hi
Anonymous
Yes please
/warn try not to be stupid and read the rules
Anonymous
Yes please
/warn ban please
xXElfGoddXx
Hi all can't get the difference correctly where should I start learn if C or C++ I was thinking going C since is first than C++ sorry for asking thanks
Anshul
I have tried to solve a problem on char arrays. And I have checked my solution so many times but can't find the error. Please help me find the error
Anshul
I'll post the question ss as well as my code
Anshul
#include<iostream> using namespace std; void MagicalPark(char a[][1000],int N,int M,int S,int K) { int curr_strength=S; int count=0; for(int row=0;row<N;row++) { for(int col=0;col<M;col++) { if(curr_strength>=K) { if(a[row][col]=='*') { curr_strength=curr_strength+5; } else if(a[row][col]='.') { curr_strength=curr_strength-2; } else if(a[row][col]='#') { break; } if(col!=M-1) { curr_strength=curr_strength-1; } count++; } else { cout<<"can't escape"<<count<<" "<<curr_strength; return; } } } if(curr_strength>=K) { cout<<"can escape as he have "<<curr_strength<<" stregth left"; return; } } int main() { int N,M; cin>>N>>M; int S,K; cin>>S>>K; char a[1000][1000]; for(int i=0;i<N;i++) { for(int j=0;j<M;j++) { cin>>a[i][j]; } } MagicalPark(a,N,M,S,K); }
Anshul
so this code doesn't runs correctly
Anshul
but an another code which is very much similar to this runs correctly. i can't find the error in above code
Anshul
#include <iostream> using namespace std; void magicalPark(char a[][1000],int m,int n,int s,int k) { bool success=true; int curr_strength=s; for(int i=0;i<m;i++) { for(int j=0;j<n;j++) { if(curr_strength>=k) { char curr=a[i][j]; if(curr=='*') { curr_strength+=5; } if(curr=='.') { curr_strength-=2; } if(curr=='#') { break; } if(j!=n-1) { curr_strength-=1; } } else { cout<<"NO"; return; } } } if(curr_strength>=k) { cout<<"YES"<<" "<<curr_strength; return; } cout<<"NO"; return; } int main() { char a[1000][1000]; int n,m,s,k; cin>>m>>n>>s>>k; for(int i=0;i<m;i++) { for(int j=0;j<n;j++) { cin>>a[i][j]; } } magicalPark(a,m,n,s,k); return 0; }
Anonymous
Recomendación libros de C para aprender?
[Gaal wase bilaa cashuur ]?_ 2 grals
If there is anyone who can help me, write me a massage. I have some difficult questions
Anonymous
Could you recommend books to learn C?
'''''''
Could you recommend books to learn C?
Let Us C by yashwant kanetkar
Anonymous
Let Us C by yashwant kanetkar
Don't recommend bad books
'''''''
Anonymous
Anonymous
Open the link and read why
'''''''
I'm a beginner like i started a week ago
'''''''
So i didn't know sry
klimi
Also do not use the book Let Us C (16th Edition, 2017) by Yashwant Kanetkar. Many people view it as an outdated book that teaches Turbo C and has lots of obsolete, misleading and incorrect material. For example, page 137 discusses the expected output from printf("%d %d %d\n", a, ++a, a++) and does not categorize it as undefined behaviour as it should. It also consistently promotes unportable and buggy coding practices, such as using gets, %[\n]s in scanf, storing return value of getchar in a variable of type char or using fflush on stdin.
Anonymous
Ok thanks!👌
Anonymous
I'm a beginner like i started a week ago
It's good so you can switch the books
'''''''
It's good so you can switch the books
So which one do u feel is better? I saw the list the bot sent.
'''''''
Ok
Anonymous
Can you attach or upload books here in the group?
Anonymous
piracy is bad.
Ok , sorry!
Anonymous
I'm new in the group
Anonymous
I'm new in the group
That's why you were supposed to read the rules but you didn't
Anonymous
I'm just reading them
Anonymous
Hey I have a question
[Gaal wase bilaa cashuur ]?_ 2 grals
Yes?
Anonymous
From a developer's point of view is it faster to use an if statement or the ternary operator?
klimi
If it is very simple statement, ternary is OK, if you are doing something that would be longer and therefore unreadable, use normal if
Anonymous
klimi
Yeah, of course
Anonymous
Okay I'll search about it
Anonymous
Properly
Anonymous
Yeah, of course
Thanks again
klimi
Anonymous
Yes?
klimi
(Statement) ? (True) : (False);
klimi
Everything depends what you want to achieve, you could write unreadable code with , if you wanted to but... Its not recommended due to readability
Anonymous
(Statement) ? (True) : (False);
Yes and I'll try to see how much I'll be able to use it
klimi
Yes and I'll try to see how much I'll be able to use it
You can write whole program with it... But it won't be readable
Anonymous
You can write whole program with it... But it won't be readable
Yes that is a very important factor for future you
klimi
Not only you, but you colleagues too
Anonymous
Yes indeed
klimi
You will realize how much it helps to have clear readable code when you have to make change in 800line file without comments in Perl (even more obscure syntax if you don't know Perl well)
klimi
What is Perl ?
Another programming language
Anonymous
Another programming language
Yeah I'm aiming to use pure code not a hybrid so will I need it ?
klimi
I said perl just as example what I do at work, but it really applies to every language
Anonymous
Really? Okay
Terlan
/get
Atakora
Wswwwswwwswwwswwwswwwswwwswwwswwwswwwswwwswwwswwwswwwswjwwowwswwwswwwwwowwowwowwowswwwuwwswwwswwwswwwswwwswwwswwwswwwswwwok
Truth
You OK buddy?
There is written "joker" 😅