1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

can anyone help me with this code...

Discussion in 'C++' started by sankari, Apr 14, 2008.

  1. sankari

    sankari Banned

    Joined:
    Feb 15, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    this is just the begining of a small project. i'm trying to get name and marks of a student usign struct.
    Code:
    #include <iostream>
    #include <stream>
    #include <sstream>
    using namespace std;
    
    
    struct progress_report
    {
       string names;
       float mark;
    } student;
       
      
      
      
    getnam (string nam,float score)
    {
      string nam;
      float score;
      
      cin >> "Enter your name";
      getline(cin,nam);
      progress_report.names=nam;
      cin >>"Enter your mark";
      getline(cin,score);
      progress_report.mark=score;
      return (progress_report.names,progress_report.mark);
    }
     
      
    int main()
    
    {
      string n;
      float mk;
      getnam(n,mk);
      
      cout << "name is " << n;
      cout << "mark is " << mk;
      return 0;
     }
     
    Last edited by a moderator: Apr 14, 2008

Share This Page