when i am executing cout<<strlen("a vinash"); in the main function, i am getting output as 7....but whereas if i execute as following
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
string a = "avinash";
cout<<strlen(a) ;
}
Now, i am getting an error that cannot covert std::string ot const chat* for argument...
User Profile
Collapse
-
Getting problem while executing strlen() in C++
-
++i is faster (or) i++ is faster in a for loop???
In a for loop like for(i=0;i<=10;i ++) and for(i=0;i<=10;+ +i).... i have heard saying that writing ++i in the for loop is faster rather than writing i++.... is that true??... is there any explaination for that??? -
@dinbock:
i haven't understood the last statement "ROUNDUP(LOG(FA CT(n),2),0)"
could u please explain it briefly -
Large Factorials in C++
Can anyone tell me how to get large fatorials in c++...in c++ i am getting the ouput upto maximum of 20!
any please help how to solve this issue. -
Difference between parameter and argument
Please tell me the difference between an argument and parameter...i was really confused in understanding the difference between these two. -
Doubt in the output
Code:#include <iostream> using namespace std; void kit() { int l = 0; static int s; ++l; ++s; cout<<l<<" "<<s<<endl; } int main() { kit(); kit(); kit(); }
-
Google chrome History
can anyone tell me how to hide the history in google chrome instead of using the incognito mode. -
Different Data types
i was actually getting a doubt that when to use long and when to use long long and what is the difference between them? and sometimes we also use long int ....couls u please clarify which data type are to be used when and where and at what situations? -
i want to know how does setw() works...pls tell with an example.Leave a comment:
-
setw() and <iomanip> Header
what does setw() function do??can u give an example...
when are <iomanip> and <sstream> header used??? -
oh..i got it...the error is that i have kept a semicolon after qwerty()...now i am getting the right answer...Thank uLeave a comment:
-
The line of Constructor is showing an error
Code:#include <iostream> using namespace std; class qwerty{ public: qwerty(); void dispalymessage(){ cout<<"Welcome to the world of Programming"<<endl; } }; int main(){ qwerty avinash; avinash.dispalymessage(); }
-
system("PAUSE") and getline function
i am confused when to use system("PAUSE") and when nnot to???
what is a getline function?
when i execute the program with int main() (or) int main(void) there is no error coming...can u explain y it is happening so?? -
Class and Structure
what is the difference between a class and a structure(struc t)...when to use class and when to use struct??? -
-
Difference between a static array and a dynamic array
can anyone explain what is main difference between the static array and a dynamic array....also i am confused with dynamic array and dynamic allocated array????can anyone help me...
No activity results to display
Show More
Leave a comment: