\Device\NUL
Not in C++
array of char and std::string template ?
Talula
array of char and std::string template ?
You can have both in C++ and one is not compatible with another, so they are not same things.
Bigissue
Hi someone help me understand why not working correctly this source code! I hear only noise. https://forum.qt.io/topic/140076/hear-only-noises-with-qaudiooutput
Anonymous
what exactly does vector<int> nums(101, 0); mean in c++? could you please help?
You know me
inspiroman
what exactly does vector<int> nums(101, 0); mean in c++? could you please help?
it's more like, arrayname(nums), sizeofareay(101) and allarrayvalues(0)
Anonymous
Given an array of size which contains elements from 0 to N-1,you need to find all the elements occurring more than once in the given array and there must be a function
You know me
Given an array of size which contains elements from 0 to N-1,you need to find all the elements occurring more than once in the given array and there must be a function
A = {1,2,2,3}, compute B = { 0, 1 ,2, 1} which are frequencies of each number as that of index. Then traverse B and collect the indices havin value > 1. If the value is not restricted to N-1 or if it is huge the you can use a map<num,frequency>
Deepak Chaurasia
// Online C compiler to run C program online #include <stdio.h> //Deepak Chaurasia main() { if (printf("hi")) { } }
Deepak Chaurasia
Why it print in if
Deepak Chaurasia
Output: hi
Anonymous
Why it print in if
Because if has to execute the expression to get a value
Anonymous
And print is just a regular function that returns an output too, which is the number of characters printed.
Deepak Chaurasia
Got it , 👍
Deepak Chaurasia
// Online C compiler to run C program online #include <stdio.h> int main() { printf("C Programm to calculate length of a integer no.\n"); int a,b,n=0 ; printf("Enter a no. "); scanf("%d ",&b); for (a =1; b <=0; a++) { b = b/10 ; n++; } printf("%d",n); return 0; }
Deepak Chaurasia
Any problem in code
You know me
What is the purpose of a ?
You know me
While(b) { b = b/10; n++; }
Deepak Chaurasia
Hmm ,good logic
Deepak Chaurasia
But why this one won't give output
Deepak Chaurasia
Let me run
Deepak Chaurasia
Still no output
Deepak Chaurasia
While(b) { b = b/10; n++; }
No output using it also
You know me
While(b) { b = b/10; n++; }
This shoud work. Add \n in the print and try again
You know me
Which compiler ?
You know me
Or ide
Anonymous
No output using it also
Sorry, b > 0, or b != 0
Deepak Chaurasia
Online
Deepak Chaurasia
Wait
Deepak Chaurasia
// Online C compiler to run C program online #include <stdio.h> int main() { printf("C Programm to calculate length of a integer no.\n"); int a,b,n=0 ; printf("Enter a no. "); scanf("%d ",&b); while(b !=0) { b = b/10 ; n++; } printf("%d",n); return 0; }
Deepak Chaurasia
No output
Deepak Chaurasia
If somebody with pc ,can run it
Crow
what did u enter
Crow
1/10=0.1
Deepak Chaurasia
10
You know me
dude, you have a space in your scanf
Crow
0.1/10=0.01
Deepak Chaurasia
Space matters?
Crow
Deepak Chaurasia
I have output now😂
Crow
my bad,its a int
You know me
Space matters?
Ofcourse. This is C, everything matters..lol
Crow
Im used to lua
Deepak Chaurasia
Ofcourse. This is C, everything matters..lol
Btw what compiler actually doing with that space
Deepak Chaurasia
🤔🤔
Crow
if u have a space in ur scanf,u should enter a space 2
You know me
Compiler doesnt do anything but printf expects something, pls read the documentation as I am away from C for a while now
You know me
Sorry I meant scanf there
Deepak Chaurasia
I learn all from yt
You know me
I can understand but reading books is important too
You know me
However, it you are not going to make a career in C then its fine for now
You know me
Prefer C++
You know me
I was a fan of C earlier then migrated to C++. Still, we are no where close to the experts in our knowledge
Deepak Chaurasia
As of a btech student i need to learn c as a part of syllabus
Deepak Chaurasia
Prefer C++
Learning it also
You know me
There few very good and knowledgable peope here like our admin. I am here to learn from them
You know me
You know me
As of a btech student i need to learn c as a part of syllabus
That is fine. Just get it done for now. Going forward you will have oops. Either C++ or java
You know me
Then DS and Algo which will require that knowledge of C++ or Java to write the programs
Deepak Chaurasia
Btw whice one to prefer c++ or java as priority
Anonymous
me personal is choose both
You know me
Its upto you. Everyone has different opnions
You know me
You should know both
Deepak Chaurasia
Ohk thanks
You know me
Can i have link
White space (such as blanks, tabs, or newlines) in the format string match any amount of white space, including none, in the input. Everything else matches only itself. Scanning stops when an input character does not match such a format char- acter. Scanning also stops when an input conversion cannot be made (see below).
Александр
Hello world! A question regarding raylib. There is DrawTextureRec function that I use and also there are other DrawTexture functions like that. But there is no function that allows me both scale my texture AND have Rectangle source variable inside it. Is there a way to scale my current DrawTextureRec without creating new function with variables that I need?
Omkar
Hii can someone help me to find out why the code is only running and not accepting input from user. (Also compiler showing 0 Errors) #include<iostream> #include<iomanip> using namespace std; class EMPLOYEE { public: int Employee_Number; string Employee_Name; float basic,DA,IT,Net_Salary; static int count; void acceptDetails() { cout<<"\nEnter Employee Number: "<<endl; cin>>Employee_Number; cout<<"\nEnter Employee Name: "<<endl; cin>>Employee_Name; cout<<"\nEnter Employee Basic Salary: "<<endl; cin>>basic; cin>>basic; count++; } void CalculateNetSalary() { DA = basic * 0.05; IT = (basic + DA) * 0.03; Net_Salary = (basic + DA) - IT; } void showDetails() { cout<<"\n--------------------------\n"; cout<<"\nEmployee Number : "<<Employee_Number; cout<<"\nEmployee Name : "<<Employee_Name; cout<<"\nEmployee Basic Salary :"<<basic; cout<<"\nEmployee Net Salary :"<<Net_Salary; cout<<"\n--------------------------\n"; count++; } }; int main() { void acceptDetails(); void CalculateNetSalary(); void showDetails(int count); return 0; }
S@IF
remove void while calling function.. inside main
S@IF
void acceptDetails(); => acceptDetails();
Omkar
Plz can anyone
Omkar
Still not Running bro
Planet
Can anyone help me interview preparation?
S@IF
Still not Running bro
u can't access member function of class ...need object to access them or else make it static