ya u r right !! savage
it is taking only 6 characters
thx a lot
till my next question bye!!
Happy weekend
User Profile
Collapse
-
thx savage
but while giving input(with width fuction) it accepts more than 6 characters
i want to limit the characters
that i shud not able to give input more than 6 characters...Leave a comment:
-
thx svlsr
ok i will get them as a string first
but i cant limit the character
Code:string string1; cin.getline(string1,5);
no matching function for cin.getline
i hav also tried this
Code:string string1; int z=5; cin.getline(string1,z);
Leave a comment:
-
length of integer or numeric values
Hi frds,
As i am getting an input value of integer (for ex: 1.413) and i want to limit the number of characters in the input value to 5
for ex:
1.413
14.13
141.3
Code:double y; cout<<"Enter the new value of displacement: "; cin>>y;
the ouput
Enter the new value of displacement:_ _ _ _ _
... -
-
hi ilikepython,
im not getting this c_str()function
im not good at this pointer things
can u tell me a little more abt y r u implying this here.. if possible?
by the way cstring is not working with my c++ compiler
as it is for visual c++ i hope!!!...Leave a comment:
-
thx "ilike python"?
but without quotes
compiler says syntax is not right (no matchhing function)...Leave a comment:
-
Path of file :filename variable
Hi friends,
I am opening and reading a file and writing it in a new file.Code:int main() { ifstream inputFile("C:\\TEMP\\test.txt"); ofstream outputFile; outputFile.open("C:\\TEMP\\test3.txt");
I have tried by adding strings but it doesnt work
Code:int main() {
Last edited by sicarie; May 30 '07, 02:07 PM. Reason: Please use [code] and [/code] tags around your code. Thanks! -
-
Thx savage
as i mentioned earlier, by using getline() function i hav not succeed
can u tell me how can i replace a particular string from a line
int main()
{
string a;
string string1;
string string2="0.000" ;
string string3="1.413" ;
string line;
fstream inputFile("C:\\ TEMP\\samp1.txt ");
fstream outputFile;...Leave a comment:
-
Read/Write file in c++
Dear friends,
im a newbee for this forum and c++ im doing my MSc in Simulation Tech in mech. Engineering. My knowledge of c++ is very little which I had during my UG studies Long long ago .I am now forced to do some programming as a small part of my thesis work. Here goes my task and question.
I want to read the text file and jus find the displacement old value and replace them with new value and write them in another...
No activity results to display
Show More
Leave a comment: