Dima
ub
Roshan
Roshan
Mine shows 0s but, I guess in pc might be showing other random values too.
Vinay
yaah in pc two value wre zeroes while others was random values Changing each time i execute
Roshan
Fun fact: if you declare vars in global scope they'll be set to 0 by default
Vinay
i want to know if somebody explain me why is there random value i m getting .. it should be nill or zero etc
Vinay
and why it is changed every time i execute i got different value
ברני
i want to know if somebody explain me why is there random value i m getting .. it should be nill or zero etc
Axel explained that to you, if you don't put values in the array, you will receive "garbage" value, random numbers or zero.
Vinay
so once a value is declared but not assigned .. then it will contain some garbage value but not empty
Vinay
so once a array*
Alex
i want to know if somebody explain me why is there random value i m getting .. it should be nill or zero etc
for stack array is garbage, for global array is zero value for all elements. because global vars are initialized once, but stack every time, so its waster of resource to init it with zero
Vinay
understood
Vinay
thanks for ur kind support very delightful people u are
Anonymous
Hi sir I am a beginner In C++
Anonymous
So please tell me how to start to become competitive programmer
Anonymous
I am in class 10
Anonymous
And Interested in SDE
ברני
Read books, check for tutorials on YouTube, they will help you here with code stroggles..
Anonymous
Sir Barney I want to become zero to advence can you suggest me something as a developer
Anonymous
I am a student of high school so I am unar to take more time... Bit intrest is too much...
ברני
Sir Barney I want to become zero to advence can you suggest me something as a developer
Im not a developer yet, I'm a student like you, I recommend to start with C, read books, watch tutorials, look for tasks in Google for your levels, and that how you'll grow
Anonymous
Ok but In which class are you ???
Adebayo
Thanks for having me here
ברני
Anonymous
hello who can help me ibatis hikaricp
Anonymous
Anonymous
ברני
hey, I wrote a code that I had to put 2 arrays on the third orgenized from smallest to the biggest, at first I had 2 garbage values at the end because the array 1 and 2 dosn't match, so after few tries I did it, my question is.. witch part in my function fixed the garbage value? (in this case it's 11 and 12}
ברני
https://onlinegdb.com/rJjt42P9D
Ali
You are supposed to make a system for a bakery. The bakery owner plans to reduce the staff and implement a system that can display the items available in the bakery with their price for the ease of customer. Different items are available in the bakery and are categorize under different options such as: Fried Items: • Chicken Samosa • Vegetable Roll Baked Items: • Chicken Patty • Potato Patty Munch Stuff: • Chips • Biscuits Beverages: • Cold drink • Juice • Water The customer can view items from different list by selecting the number associated with each list. If the customer wishes to exit the menu, he/she will be redirected to the beginning of the system where about the bakery and menu option is available. Hint: Use do-while loop.
Ali
/warn nice homework assignment bruh
Can u help me out I'm a beginner
Roxifλsz 🇱🇹
Can u help me out I'm a beginner
You should write most of the code yourself and then ask for help when you get stuck
Roxifλsz 🇱🇹
Now you're just asking for someone to do your complete assignment
ברני
I think it will be done with if than else
Write the code first, when you'll get stuck we're here
Engineer
Where is sizeof defined?
Xudoyberdi
Engineer
I am creating a virtual CPU with a cross compilation stage. I thought I knew sizeof but I'll need to dig deeper to find out...
Engineer
https://en.m.wikipedia.org/wiki/Sizeof
Engineer
https://en.m.wikipedia.org/wiki/C_data_types#limits.h
Roxifλsz 🇱🇹
Where is sizeof defined?
It's part of the language
Engineer
Yes but to be able to closely coupled with the hardware it needs to be implemented
Engineer
64bits CPU
Anonymous
/warn offtop and screen photo
Hermann
Do you know any editors with a dark theme? . I think I avoid vim, I need to practice some c ++
Anonymous
Most of them have
Hermann
mmm seach open editor but no microsofts editor XD
Dima
Vs code
It’s not an ide
Roshan
see the windows, I meant it
ברני
Hey again, I have a new task, got to 2d arrays on C.. and I don't understand how to make a function with 2d array... this is what I tried but it marks it as an error on visual: https://onlinegdb.com/HJHAqJO5D
ברני
"a parameter is not allowed"
Manav
"a parameter is not allowed"
That is not how you pass arrays to a function as a parameter.
ברני
Yes, so how?
Manav
Were you not taught about types and pointers?
Manav
Arrays decay to pointers, use that
ברני
I didn't got to pointers yet... I know array is a pointer but I didn't got to pointers in class
Manav
I would suggest you throw away the book/resources you are learning from.
ברני
And your answer is?
Manav
And your answer is?
Use the above given signature you have at line 3
hazer_hazer
Hi, i've got a question. I have main namespace (project name) And nested namespaces. Why I need to write project_name::nested::..., but not nested:: if i'm already in jc::namespace::another_nested? Example: namespace project_name::nested { void foo(); } namespace project_name::another_nested { void bar() { project_name::nested::foo(); } } Why I need to write project_name if I'm already in project_name namespace but in different nested?
Gulshan
#include <ios> //use to get stream size #include <iostream> #include <limits> #include <map> #include <string> int main() { int queries; std::cin >> queries; std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); // clear buffer before taking new line std::string query[queries]; int type[queries]; for (int i = 0; i < queries; i++) { std::getline(std::cin, query[i]); // type[i] = query[i][0]; // std::cout << "Type is : " << type[i]; std::cout << query[i][0]; type[i] = query[i][0]; std::cout << "\ntype is : " << type[i]; } return 0; }
Gulshan
why type[i] is printing something diff.. which is not being printed by query[i][0]
Gulshan
Inpu: 1 1.hey 1 Output: type is : 49
Manav
And your answer is?
Oh wait I was mistaken. I re-read your code you have a 2d array, so you need pointer to a pointer #include <stdio.h> int printArray(int** array, int columns, int rows); // <—— here your declaration :) void main() { int array[4][3] = { // stuff }; printArray(array, columns,rows); } int printArray(int** array, int columns, int rows) { // stuff }
Manav
As I told you, I didn't get to pointers yet, I fixed my problem by adding the clms number : int arrayCall(int rows, int columns, int array[] [3]); Ty anyway
Hmm, that's really strange then, you can't talk about arrays without talking about pointers since arrays decay to pointer, which means int arr[3] = {1,2,3}; *(arr + 1) is equivalent to arr[1]