User Profile

Collapse

Profile Sidebar

Collapse
SUNIL TYATA
SUNIL TYATA
Last Activity: May 14 '10, 09:46 PM
Joined: Feb 4 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • SUNIL TYATA
    replied to how to change the array in for loop
    in C
    I am not allowed to use either two dimensional array or structure in this question. Is there any logical solution?...
    See more | Go to post

    Leave a comment:


  • SUNIL TYATA
    started a topic how to change the array in for loop
    in C

    how to change the array in for loop

    I ve five different arrary of test scores
    person 1 -> test_score1[4]
    person 2 -> test_score2[4]
    how to change to array of test_score1 to test_score2 in for loop for person1 to person2 to insert the values in test_score array.


    Code:
    for(int i=0;i<5;i++)
    {
    cout<<"Give the name of the student "<<i+1<<": ";
    cin>>names[i];
    cout<<"Give
    ...
    See more | Go to post

  • SUNIL TYATA
    replied to How to an array to a function
    in C
    IF you dont use the function floor(...) in your code then I made simple solution may it will help you. Thanks
    #include<iostre am>
    using namespace std;
    int determinePage(i nt);


    int main()
    {
    int page_number;
    static int virtual_addr[10]=
    {8196,34893,385 83,22883,61843, 43532,333,8448, 2334,9492};

    cout << "Page Number is: " <<endl;...
    See more | Go to post

    Leave a comment:


  • SUNIL TYATA
    replied to How to an array to a function
    in C
    the function named floor(.......) used is not identified by c++ complier or is it user defined function?
    See more | Go to post

    Leave a comment:


  • SUNIL TYATA
    replied to Problem in file handling!
    in C
    If you are talking about the forward slash for the path of the file as long as I know and it works with out any problem.

    c:/tc/email.txt
    file path is working


    But once If i give the file path like
    c=/tc/m.txt //in this file path there is something wrong in place of colon it was '=' sign.

    this is going to be incorrect and while loop certainly give error message to the user with...
    See more | Go to post

    Leave a comment:


  • SUNIL TYATA
    started a topic File handling String related question
    in C

    File handling String related question

    I've declared the string realPath as
    string realPath;
    realPath = "c:/tc/matrix.txt";

    when i use realPath for the path of file to open like

    fstream infile;
    infile.open(realPath, ios::in); //This line generate error like
    ///////////////////////////////////////
    error msg:
    1>.\read_matrix _table.cpp(31) : error C2664: 'void std::basic_fstr eam<_Elem,_Trai ts>::open(const...
    See more | Go to post

  • SUNIL TYATA
    replied to Problem in file handling!
    in C
    I did use cin.ignore() with in while body but same problem no change...
    See more | Go to post

    Leave a comment:


  • SUNIL TYATA
    started a topic Problem in file handling!
    in C

    Problem in file handling!

    Once the program goes through the while loop which is checking the file existence like in this code

    Code:
    #include<iostream>
    #include<fstream>
    using name space std;
    int main()
    {
    read_emails();
    return 0;
    }
    
    void read_emails()
    {
    fstream infile;
    
    char path[100];
    cout<<"Format of the path is like this: c:/tc/test.txt";
    cout<<"Give
    ...
    See more | Go to post

  • SUNIL TYATA
    replied to Declaring an array with size in C++
    in C
    Thank for reply but actuall I am talking about the array length not the size in bit or bytes.
    See more | Go to post

    Leave a comment:


  • SUNIL TYATA
    replied to Reading in text file in c++
    in C
    I did it! Thanks for encouragement see u with next Quest...
    See more | Go to post

    Leave a comment:


  • SUNIL TYATA
    replied to Reading in text file in c++
    in C
    But It has already been said in the question that Your program should handle up to 20 integer numbers. Declare the array as a global variable..
    In the real code I am not supposed to make the array of size 21. Thank you!
    See more | Go to post

    Leave a comment:


  • SUNIL TYATA
    replied to Reading in text file in c++
    in C
    Its ok counter part I will handle it. but isn't there any function in fstream
    library that will help me to loop through the text file till second last of the number list.
    The actual question is like this
    Q. Write a program that will manipulate an array. Your program should handle up to 20 integer numbers. Declare the array as a global variable. (This is the only time you should use a global variable.)

    ...
    See more | Go to post

    Leave a comment:


  • SUNIL TYATA
    replied to Declaring an array with size in C++
    in C
    I knew that It does work like nums.length work as a value for the size of the array in java but I need the code for the c++. Thank You though.
    See more | Go to post

    Leave a comment:


  • SUNIL TYATA
    replied to Reading in text file in c++
    in C
    wher I can use the code you send me

    your code is below

    ifstream myfile;
    myfile.seekg(SE EK_END - 2*sizeof(int));

    in my code bellow

    #include<iostre am>
    #include<fstrea m>
    using namespace std;
    int main()
    {
    const int size = 20;
    int arr[20];
    int count=0;
    fstream infile;
    infile.open("c:/C++/array1.txt");...
    See more | Go to post

    Leave a comment:


  • SUNIL TYATA
    replied to Reading in text file in c++
    in C
    If I dont know how many number are there in the file. It might more than 12 might be 14 or 16 or 17 whatever (within 20). Here I've to pick up the numbers up to second last from a file.
    like I already create global array as

    #include<iostre am>
    #include<fstrea m>
    using namespace std;
    int main()
    {
    const int size = 20;
    int arr[20];
    int count=0;
    fstream infile;...
    See more | Go to post

    Leave a comment:


  • SUNIL TYATA
    started a topic Reading in text file in c++
    in C

    Reading in text file in c++

    I've 13 int number as a list in txt file.
    34
    55
    99
    120
    57
    45
    49
    30
    32
    21
    56
    22
    0


    The last value is a 0 and is NOT one of the values to be used in any calculation . I am supposed to create only one array as global variable.
    So what would be the logic behind(with code) to read all the numbers from the file except the last one (i.e,...
    See more | Go to post

  • SUNIL TYATA
    started a topic Declaring an array with size in C++
    in C

    Declaring an array with size in C++

    The java code below is well functioning code where I did was;
    I used nums.length as the size for the declaring the new arrary within the function body.

    Code:
    public int[] reverse3(int[] nums) 
    {
     int[] temp = new int[[B]nums.length[/B]];
     for(int i=0;i<nums.length;i++)
     {
      temp[i] = nums[nums.length-(i+1)];
     }   
     return temp;
    }
    If I am trying to do the same thing...
    See more | Go to post

  • what is the best solution to create an array of variable size.

    If any body could give me the solution of how to create and array of variable size in java or in c++ (Note: except the linked list concept).
    Please!
    would be very appriciable Thank you!
    See more | Go to post
No activity results to display
Show More
Working...