Hariyana Grande
my brain cells died i cant handle lol need to change career
Ilya
Pointer just points to the memory cell
Hariyana Grande
i have been studying c since last two months it was going well good untill pointers came in my life
Hariyana Grande
i was happy for loop while loops those sweet things
Ilya
Dont worry. You will understand it in a few weeks
Hariyana Grande
hope so bye see u around take care
Ilya
You are welcome
M
Hi
M
I am trying to learn app reskining but I don't have source codes to work on can someone plzz provide few apps source codes
Ilya
github.com
Anonymous
guys how can we convert this code to stdio.h
Anonymous
this code works perfectly fine but the prof doesnt accept iostream
Anonymous
#include <iostream>
using namespace std;
int getTreeCount(double side1, double side2, double distance)
{
double n1, n2;
int count;
n1 = (side1/distance) + 1;
n2 = (side2/distance) + 1;
count = 2* (n1 + n2) - 4;
return count;
}
int main()
{
double side1, side2, distance;
cout << "Enter the length(in meters) and breadth(side 2) of rectangular field: ";
cin >> side1;
cin >> side2;
cout << "Enter the distance between two trees: ";
cin >> distance;
int count = getTreeCount(side1, side2, distance);
cout <<"\nThe count of the trees is that could be planted are: "<<count;
return 0;
}
Hermann
how check next value in a valied value with pointer? if ((src+1)) not work [c++]
Anonymous
i only have 90 minutes left for the deadline im in desperate need of ur help
Anonymous
wait sorry i forgot that u guys don't help solving questions that are used in old ass devc++
Atropos
Anonymous
i see. ill try my best. thanks a lot.
Ilya
Ilya
If you want value, you need to dereference the pointer by using operator '*'
Ilya
It means you are trying to get the memory that doesnt belong your program
Ilya
Why do you want to get src+1?
Ilya
Show me code
Ilya
/get cppbookguide
Anonymous
only if i was allowed to send u the question but this goes against the rules i guess
Anonymous
do u want me to send it in private? @dobrii_el @The_h3rmann
Ilya
Anonymous
dont worry about it
Anonymous
well anyways i tried to redo it
Anonymous
#include <stdio.h>
int treeCount (int len , int wid , int dist);
int main(void){
int len , wid;
int dist;
printf("Input length : ");
scanf("%d", &len);
printf("\nInput width : ");
scanf("%d", &wid);
printf("\nInput distance between trees : ");
scanf("%d" , &dist);
//calling function
treeCount(len , wid , dist);
return 0;
}
//End of main
int treeCount (int len , int wid , int dist){
int perim = (len + wid)*2;
int tree = perim/ dist;
return printf("\nResult : %d", tree);
}
Anonymous
but there's sth missing
Ilya
\n
Ilya
add this to the text in " "
Ilya
for example "%d\n", &dist
Ilya
no, sorry, i've disoriented you
Ilya
printf("Result: %d\n", tree);
Anonymous
yeah i solved the problem thanks a lot
Hermann
Maybe I can calculate length pointer
Ilya
Pointer for what?
Hermann
Ilya
Goddamn, dude
Ilya
Why do you need this? Are you iterating over an array or ..?
Anonymous
Ilya
mistake there, you're right.
int *parr = arr;
Just typo.
Fixed.
Hermann
Black
Hi
Black
Anyone ready to build a team to work on a project together
Black
Together we can provide the world with fun and good services ❤️🙏
Anonymous
Black
Black
If you don’t mind
Anonymous
Black
hmm yes.
Waiting for your reply in your dm
King Phyte 🐍
Black
🤔
King Phyte 🐍
I don't understand
ая
Any method to know size of array (last index)?
King Phyte 🐍
Ohh...
You mean I gotta tell him to DM me?
ая
Papa
What is the main diff btw private and protected...
hiddenpiggy
std::size(array)
hiddenpiggy
What is the main diff btw private and protected...
we have a base class A,which has dozens of protected members. if there is a class B(publicly inherited from class A) then B has access to the protected members of class A. but the private ones dont...
Papa
Power Serves Reason
Hello everyone, I am a cpp starter.
Anonymous
Anonymous
Anonymous
It's not good
it's "C" and C++ group and he didn't specify which language he wanted, the code that I wrote works for both.
Anonymous
Anonymous
It's common knowledge
Anonymous
Nameful
Shouldn't be the other way around
Anonymous
Nameful
No
In my experience C programmers tend to be the elitist ones?
Anonymous
hiddenpiggy
Me too
hiddenpiggy
I think object-oriented programming paradigm is also important
Anonymous