Thank you very much...I understand it all now.
Thanks again.
User Profile
Collapse
-
Thanks Banfa....my previous problem is solved but now I have another question.
When mixing std::strings and character string literals like:
s2 should contain only one null at end of s2. Isn't it?Code:std::string s1 = "hello" std::string s2 = s1 + ", " + "world"
What happens to null that exist at end of s1 and character string literals ", " and "world"?
...Leave a comment:
-
Well, I checked with my gcc 3.3.5 whether null is appended to end of std::string object:
The cout prints nothing while printf prints 0 (note this is...Code:#include <iostream> #include <cstdio> int main() { std::string temp("hello"); std::cout << temp[5] << std :: endl; printf("%x", temp[5]); return (0); }Leave a comment:
-
And yes, from what I've read, I think that std::string object does NOT terminates with a null character...I just want to confirm this :)Leave a comment:
-
SchoolOfLife started a topic Does an object in C++ of std::string type terminates with null character?in CDoes an object in C++ of std::string type terminates with null character?
Does an object in C++ of std::string type terminates with null character?
The charater string literals in C++ (to maintain backward compatibility with C) end with a null character. Is this same with an object of std::string type?
Thank you... -
I don't know a solution to your problem, but which version of Redhat linux are you using? RHEL? I'm asking this because Redhat linux was unsupported a few years back. Redhat supports RHEL and fedora project now.Leave a comment:
-
Hello,
sorry for not replying. My friend who lives in another country has not appeared online since then. There is no other way to speak to him other than IM and social networking sites. I tried connecting to another machine of a friend of mine locally using SSH and succeded (got some help from #ubuntu IRC on freenode for this).
So, there is nothing I can do right now :(
Thanks for your time anyways.Leave a comment:
-
Sorry for not replying back. The system that I'm trying to connect to belongs to one of my friend who is busy with some stuff right now. So, I couldnot reach him. I got a mail from him today and it seems that things are going well now with him. He assured me that we will do this SSH stuff asap.
So, I'll be back with updates (and more questions) soon.
Thank you very much for replying...Leave a comment:
-
Thanks Banfa.
Although the original question is still unanswered, but I'm glad that I learnt a few concepts from this discussion (like += is more efficient than +, the concept; in += original value of lhs is overwritten).
Currently, I'm studying chapter-3 from C++ primer, so I hope that once I'm done with this book, I will get some answer. Till then, I suppose we can 'pause' this discussion. If I find answer, I will post it here....Leave a comment:
-
Thanks....
oh yes...I now understand atleast some part of Sales_item.h file.
I read some C long time ago, but I dont get what you mean by "using + rather than += is you need to keep the original value of the lhs of the equation". Can you please explain this to me?
Anyways, here's the code:
...Code:#include <iostream> #include "Sales_item.h"
Leave a comment:
-
-
I searched google and found some satisfactory answers. (e.g. link. So, imo my problem is solved now. I should have tried searching before I posted this thread. Nevermind
Thanks anyways,Leave a comment:
-
Why there is no distinction between signed and unsigned float types?
Hello,
When I try compiling this code:
with variable declarations of type signed float and unsigned float, gcc 3.3.5 outputs:Code:signed float fl1=-10e-2;
"Why there is no distinction between signed and unsigned float type in C++?"Code:error: short, signed or unsigned invalid for `fl1'
Thanks... -
I searched google, read manpage and a few tutorials yesterday after I psoted this thread. I now understand that answer to my original question is yes. But the problem is that I can connect to localhost and other systems in LAN but when I try to connect to some system that is not in my LAN, Openssh simply does nothing. Any ideas about what might be causing this?
Thanks..
SchoolOfLife...Leave a comment:
-
Hello,
Thanks...
I don't know much about C++ classes yet as I'm presently studying chapter-2 from the book. And so, I'm confused with this question.
The book says that the class supports addition (+), input (>>), output (<<), assignment (=) operators and a same_isbn member function. But I just want to confirm that I'm right.
Anyways, I'm attaching the file "Sales_item .h" (renamed...Leave a comment:
-
Simple question about classes...
Hello,
I'm studying C++ all by myself. I'm studying from C++ primer (4e) by S.B.Lippman, J. Lajoie and B.E.Moo.
In chapter-1, there's a question whose answer I want to confirm. The question says:
I think the answer to this question is that compound assignment operator is not a valid operation that is allowed on Sales_item objects. But I'm sure whether this is correct.
Am I getting it right? If not, where... -
Can I remotely login to a PC (not in my LAN) using SSH (or similar)?
Hello,
I am new to this networking stuff. I'm using OpenSSH that ships with Ubuntu.
Actually, I read lots of tutorials about SSH but I can connect to localhost or any other system in LAN but I cannot connect to my friend's system in another country.
Is it possible to connect using SSH from my ubuntu system in one country to another (linux) system that is located in another country?
Thank you,...
No activity results to display
Show More
Leave a comment: