User Profile

Collapse

Profile Sidebar

Collapse
sheriff
sheriff
Last Activity: Jun 4 '07, 11:50 AM
Joined: May 29 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • sheriff
    replied to length of integer or numeric values
    in C
    ya u r right !! savage

    it is taking only 6 characters

    thx a lot

    till my next question bye!!

    Happy weekend
    See more | Go to post

    Leave a comment:


  • sheriff
    replied to length of integer or numeric values
    in C
    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...
    See more | Go to post

    Leave a comment:


  • sheriff
    replied to length of integer or numeric values
    in C
    thx svlsr

    ok i will get them as a string first

    but i cant limit the character

    Code:
    string string1;
    cin.getline(string1,5);
    it saying

    no matching function for cin.getline

    i hav also tried this

    Code:
    string string1;
    int z=5;
    cin.getline(string1,z);
    i cant able to use any delimiter too as i am giving input
    See more | Go to post

    Leave a comment:


  • sheriff
    started a topic length of integer or numeric values
    in C

    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:_ _ _ _ _

    ...
    See more | Go to post

  • sheriff
    replied to Path of file :filename variable
    in C
    thx python it is working

    thx a lot...
    See more | Go to post

    Leave a comment:


  • sheriff
    replied to Path of file :filename variable
    in C
    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!!!...
    See more | Go to post

    Leave a comment:


  • sheriff
    replied to Path of file :filename variable
    in C
    thx "ilike python"?

    but without quotes

    compiler says syntax is not right (no matchhing function)...
    See more | Go to post

    Leave a comment:


  • sheriff
    started a topic Path of file :filename variable
    in C

    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");
    But I want my new file (outputfile) as a variable

    I have tried by adding strings but it doesnt work
    Code:
    int main()
    {
    ...
    See more | Go to post
    Last edited by sicarie; May 30 '07, 02:07 PM. Reason: Please use [code] and [/code] tags around your code. Thanks!

  • sheriff
    replied to Read/Write file in c++
    in C
    thx much savage i did the same...
    See more | Go to post

    Leave a comment:


  • sheriff
    replied to Read/Write file in c++
    in C
    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;...
    See more | Go to post

    Leave a comment:


  • sheriff
    started a topic Read/Write file in c++
    in C

    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...
    See more | Go to post
    Last edited by AdrianH; May 29 '07, 03:16 PM. Reason: INDENT YOUR CODE!
No activity results to display
Show More
Working...