Cin's getline function

hi everybody,
i wrote a program that decodes a text file that has been encrypted using a substitution cipher
i've never used cin's getline function before ... can anyone tell me please how can i prompt the user for a file name, and read the file name from the keyboard using cin's getline function. It should open the file designated by the file name. If you can't open it, print an error message and exit. If you can open it, then the program should decode the contents and display them on the monitor.
Here is my program:
#include<iostream>
using namespace std;
int main() {
char szPoem[] =
"7Staqnjxy4tk4ywjjx4ymj4hmjwwd4stb"
"7Px4mzsl4bnym4gqttr4fqtsl4ymj4gtzlm"
"7Hsi4xyfsix4fgtzy4ymj4bttiqfsi4wnij"
"7Djfwnsl4bmnyj4ktw4Lfxyjwynij"
"77Utb4tk4rd4ymwjjxhtwj4djfwx4fsi4yjs"
"7Abjsyd4bnqq4sty4htrj4flfns"
"7Hsi4yfpj4kwtr4xjajsyd4xuwnslx4f4xhtwj4"
"7Py4qjfajx4rj4knkyd4rtwj"
"77Hsi4xnshj4yt4qttp4fy4ymnslx4ns4gqttr"
"7Mnkyd4xuwnslx4fwj4qnyyqj4wttr"
"7Hgtzy4ymj4bttiqfsix4P4bnqq4lt"
"7At4xjj4ymj4hmjwwd4mzsl4bnym4xstb77"
char szPlain[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
\n1234567890?";
char szCifer[] = "fghijklmnopqrstuvwxyzabcdeHIJKLMNOPQRSTUVWXYZABCDEFG47!@#$%^&
char *cp = szPoem";
for( ; *cp; ++cp ) {
char p = strchr( szCifer, cp ) ;
putchar( p ? szPlain[ p - szCifer ] : '~' );
Lovliest of trees the cherry now
Is hung with bloom along the bough
And stands about the woodland ride
Wearing white for Eastertide
Now of my threescore years and ten
Twenty will not come again
And take from seventy springs a score
It leaves me fifty more
And since to look at things in bloom
Fifty springs are little room
About the woodlands I will go
To see the cherry hung with snow
thanking you,
jane

Your textbook should probably have info on iostreams, or try a google search http://www.google.com/search?hl=en&q=iostream+tutorial. You'll want to look at std::cout for displaying prompts, std::cin for reading the filename, and std::ifstream for reading from the file. If you have learned std::string, it would be better to learn to use std::getline(std::istream& strm, std::string& str), instead of std::istream::getline(...). That way so you won't have to worry so much about maximum line length.
Josh Walker

Similar Messages

  • How to read data from a file

    I have a file that looks like this with out the *'s
    lastName firstName number
    lastName firstName number2
    lastName firstName number3
    lastname = (string) an actual last name like smith same for first name
    number = an actual number (int) like 90 or 120
    I need to read the number from this file and store it in an array. I have some code that I started, but im not sure what to do next. Please help!
    //int searchId;
         int fileData;
         vector <int> employeeIds;
         //cout<<"Enter Employee ID: ";
         //cin>>searchId;
         ifstream dataFile("Small-Database.txt");
         dataFile >> fileData;
         while(!dataFile.eof())
               //this is where i need help, how can i read in a number. i tried using the getLine() function but it did not help
              //employeeIds.push_back(fileData);
              //dataFile >> fileData;
         dataFile.close();Thank you for any help in advance

    The >> operator reads a value corresponding to the target type. For example, to read an integer value, read it into an int variable (or long or long long, depending on the integer range).
    The >> operator skips white space (blanks, tabs, newlines) and then reads characters corresponding to the target type: digits for an integer value, for example. It stops at the first character that cannot be in the representation of the type. If no characters are read, the stream goes into an error state, and further I/O requests are ignored until you clear the stream state.
    You can read each group of data like this:
    std::string first, last;
    int number;
    dataFile >> first >> last >> number;If the data doesn't have the right characteristics, the stream will go into an error state, which you can detect by testing the stream directly:
    if( dataFile ) ...Using EOF as the loop control is not a good idea, since if there is an error, the loop will never terminate. You can do something like this:
    while( dataFile ) {
        std::string first, last;
        int number;
        dataFile >> first >> last >> number;
        if( dataFile ) {
            // ... add first, last, number to the data structure
    } Reading past EOF puts the stream in an error state, so checking the stream state before saving the data and in the loop control will do the trick.
    You can use a char array instead of a string for the names, but then you have to add extra testing to be sure you don't overflow the array, and deal with the extra characters you don't read. Strings will expand as needed. The string is declared as a local variable in the loop, so it gets re-initialized each time through; you don't need to write code to reset it.
    My example loop is not robust in the face of errors. Stream I/O works fine when you know the input data is well-formed. It is not suited to input that can be wrong, such as data typed from the terminal, because it is not easy to validate the input and recover from errors.

  • Stored proc execution status, pls help

    hi,
    i need to know if there is a way to find out whether an sp has been executed successfully or not, with the status code being returned.
    i know about the dbms_output.getline() function but i don't know how to use it!
    pls help
    thank you

    Hi,
    do you mean something like that ?
    SQL> create or replace procedure getData(id in number)
      2  is
      3   status number;
      4  begin
      5   select count(1) into status from emp where empno = id;
      6   if status > 0 then
      7     dbms_output.put_line('Success');
      8   else
      9     dbms_output.put_line('Failed');
    10   end if;
    11  end;
    12  /
    &nbsp
    Procedure created.
    &nbsp
    SQL> set serveroutput on
    SQL> exec getData(1)
    Failed
    &nbsp
    PL/SQL procedure successfully completed.
    &nbsp
    SQL> exec getData(7369)
    Success
    &nbsp
    PL/SQL procedure successfully completed.
    &nbspRgds.

  • JTX1,JTX2,JTX3,JTX4 and UTXJ

    Hi friends,
    Can anyone tell me whats the use of JTX1,JTX2,JTX3,JTX4 and UTXJ  and how should be the value updated in the Customer and Material master sales views for the respective condition types ?
    Thanks
    Ivy

    Ivy they all are used in CIN
    Here is a really long discription for the same
    CIN determines taxes based on the chapter-id of the material. There are 2 levels for rate determination. First the system will check if there is an exceptional rate available. If this is available then that rate is picked up. This rate could be for a material or material and customer combination. If there are no exceptions then the system looks for chapter-id of that material. The customer will have an excise tax status which along with the plant status will give a final excise status. Based on the excise status and the chapter-id the rates are maintained.
    Can I change the tax rates retrospectively?
    You can change the excise rates with any given validity period. After making the changes you will have to update the sales orders if the new tax rates have to be considered for future deliveries.
    Can I have a different rate for incoming and outgoing transactions for the same material?
    You can maintain exceptional rates for either incoming or outgoing based on the volume of exceptions data.
    What do I do if I have one chapter-id for incoming and another for outgoing and material code is the same?
    Along with exceptional rate maintenance you can maintain the chapter-id which should be used for the outgoing transactions. This chapter-id will be used only for copying on to the document and will not be used for rate determination.
    Can I have some more additional rates?You can maintain multiple excise indicators and based on that you can have additional
    rates.
    What will happen if I have multiple rates with overlapping validity periods for the same chapter-id and tax indicator?
    While picking up the rate for a given transaction system will check for that validity period where the valid from is the maximum but with in the pricing date and based on that pick up the rate applicable.
    How does CIN do the pricing?
    CIN uses R3 condition technique for pricing along with the pricing formulae. Details are available in the CIN knowledge bank. Template pricing procedures are provided for various sales scenarios.
    How many tax codes do I need?
    The number of tax codes will directly depend on how you want to account the sales tax. You can have CST and LST being determined by the same tax code if both can be accrued into the same account. Instead if you need separate account determination then you need separate tax codes. Also based on the tax concessions available you need to decide the various tax rates which need to be mapped.
    How do I open up more than one tax classification?
    CIN comes with default customization to open up the tax classificvation fields. The procedure is as follows. You need to define as many condition types as the number of tax classification fields. Tbe following procedure could be used.
    • SPRO - Sales and distribution -Basic functions-Taxes - Tax
    determination rules For Country 'IN' make entries as follows (This
    is precustomized in client 000 )
    Seq 1 - UTXJ
    Seq 2 - JTX1
    Seq 3 - JTX2
    Seq 4 - JTX3
    In SPRO - Sales and Distribution - Basic functions - Taxes
    Determine tax relevancy of master records
    How do I handle concessional excise?
    This is explained in SAP note 335577. Having opened up the new tax classification
    fields you might have to do the following
    --> Customer taxes maintain the possible values for JTX3 . Each unique value should denote one concession rate. For eg 1 - normal excise duty
    --> Maintain the JTX3 value against the form code in J1IT -Define Form types
    Maintain the customer tax classification in customer master if the customer has got
    excise exemption
    --> Maintain the excise indicator in J1ID for the customer and form code and this indicator gives the final indicator
    --> Forms database is used for determination of whether the form has arrived or not at the time of billing.
    --> The tax classification value gets defaulted from the customer master in the sales order. This can be changed in the header
    billing data if required
    How do I handle sales tax concessions?
    SPRO - Sales and distribution -Basic functions-Taxes - Tax determination rules For Country 'IN' make entries as follows (This is precustomized in client 000 )
    Seq 1 - UTXJ
    Seq 2 - JTX1
    Seq 3 - JTX2
    Seq 4 - JTX3
    -> Taxes - Determine tax relevancy of master records - Customer taxes maintain the possible values for JTX1 and JTX2. Each unique value should denote one concession rate. For eg 1 - 4% . Multiple forms could correspond to a single rate. JTX1 could be used for CST and JTX2 for LST. (UTXJ could be freely used by the customers as earlier )
    -> Maintain the tax classification in customer master as well as
    material master ( Sales org data 2)
    Build access sequences based on these new fields to point to the correct sales tax code You might have to have a new access based on region of delivering plant and region of ship to party
    How does CIN handle Indian VAT?
    VAT is handled separately & not linked to CIN..
    When I create a new tax code the excise lines are grey and I cannot maintain any value. What should I do?
    This is happening because the Excise conditions for sales are statistical in the tax procedure for India. So while creating a new tax code you need to open the tax procedure remove the statistical flag, maintain 100% for all excise conditions. After saving the tax code you need to make the conditions statistical once again.
    When I release the billing document to accounting there is an error that the account key is missing?
    This is happening because one or more lines in the tax procedure has a condition with a value but is not marked statistical. You need to check whether the conditions JMOD, JAED, JSED and JCES are marked statistical in the tax procedure. You cannot rectify the documents which are in error. The correction takes into effect only the future orders.
    When I release to accounting I get a message tax amount greater than tax base?
    This is happening because the tax base for some tax condition is falling less than the tax base amount. R3 does not allow the tax base to fall below the tax amount. You need to check which condition is giving the problem and based on that you can verify the tax procedure from-to settings.
    Do I need to maintain the chapter-ids for each plant or can it be left blank?
    If the same chapter-id is applicable for the material in all the plants then you need not maintain the chapter-ids for all the plants. You can leave the plant blank.
    When I try printing the excise register nothing comes up?
    Check whether you have maintained the opening balance for the item in the corresponding register (Table J_2IACCBAL for register account balances). Next check whether you have maintained the sapscript forms which are used for printing the registers in the CIN configuration. Finally check whether the extraction has been done for the period.
    When I try printing the excise invoice the list line turns red and nothing happens?
    This is becaue you have not maintained the condition record for output determination. You need to maintain the condition record for output determination at the sold to party level. Also for the documents created already you can go into Billing header – output and manually enter the output type j1io and save. Later the excise invoices can be printed.
    When I try to create RG1 issues entry the line turns red and nothing happens?
    This is happening because you are trying to create an issue entry and the stock in the register is not enough to do the issue. So you need to first update RG1 with the receipts and then go into the issues.
    I have extracted the register data once but now I have added more transactions. Can I extract once more?
    You can re-extract the data if you have added more transaction data for the given period.
    I am using another package for printing registers. Can I download the data once again?
    To prevent data inconsistency in the third party application CIN does not allow you to re download the register data once it has already been downloaded.
    What is the issue classification for RG1?
    You need to classify the RG1 entries as to whether they are receipts from manufacture or other receipts, clearances of various types so that they can be reported under the various headings as required by the Excise commissionerate.
    How do I maintain the opening balances for my register for the first time?
    You need load them manually at the initial data upload.
    How do I get the opening balance for every month?
    CIN calculates the opening balance for reporting purposes based on the transaction s extracted in any period.
    Are opening and closing balances of reghister available for me for reporting?
    You must not pick up the opening and closing balances that are calculated by reporting because they might get changed if some one does a re extract. So they need to be recomputed dynamically. They are not stored.
    Can I round the duty at the header level?
    Duty can be rounded off in CIN only at the item level. Due to technical reasons duty round off is not provided at the header level.
    When I create an excise invoice for exports what exchange rate will the system take?
    System picks up the exchange rate which is maintained in the CIN configuration data for the company code.
    With fortnightly utilization why do I need a part2 entry at the time of Excise invoice creation?
    With fortnightly utilization you do not create an entry in the CENVAT or PLA registers. Instead CIN keeps a separate Despatch register and generates continuous serial numbers in this register that can be used for future reconciliation.
    Do I need to have balances in my CENVAT accounts at the time of Excise invoice creation?
    At the time of excise invoice creation the debit is being made into an Excise payable account. So you need not have balances in the CENVAT account. You need to have enough money at the time of fortnightly utilization or you should have made a debit through TR6 into PLA.
    What are the exceptional reports possible?
    You can list all the billing documents for which excise invoice is not created. You can get a list of all excise invoices for which billing document has been cancelled., You can also have a report of all cancelled excise invoice for which the billing document is still open.
    Can I know which are the billing documents for which there is no excise invoice?
    Excise due list gives you all billing documents for which there is no excise invoice.
    Number range skipping happens for excise invoice. What could be the reason?
    CIN number ranges are defined as not buffered. You need to check if this has been changed. If skipping happens never reset the number range.. you must report the problem to SAP support immediately so that they can help you resolve this.
    While doing excise invoice creation I get an error message that system failure during locking. What can I do?
    While creating the excise invoice, at the time of saving system tries to lock the GL account that is getting updated with the new balances. S probably some one else could be changing the GL account data at that point of time. This is a very short phenomena and is meant to keep the data consistency.
    While doing depot sales invoice selection, list of invoices are not getting displayed. Why?
    You need to check the customization settings for LIFOor FIFO and the invoices of which period you have set. Also you need to check the excise group which is being used. System will show you only those excise invoices which belong to the same excise group, plant, storage location and batch.
    How do I handle the a-certificate at depot?
    A certificates come when the goods are removed after paying a provisional duty. When the final price is decided at the time of the order you need to pay the balance of the duty. There is no facility at the moment to calculate the differential duty. You have to make the payment manully using J1IS at the factory. Once this is done you can go back to the depot and capture this extra payment into your RG23D. This is recorded as a new serial no with in the original folio so that the RG23D register value tally. At the time of selection of excise invoice for sale you have the option to pick up the a-certificates for the excise invoice and then the additional duty gets added into the invoice amount. Also this is reflected in the RG23D register.
    Is it possible to add some additional duty on to the depot invoice with out A certificate?
    No you need an A certificate if you have to get an additional duty in RG23D invoice. Alternative is to write customer specific routines which are not supported by CIN.
    How do I handle the returns at depot?
    If there are returns to depot, that can be captured as any other receipt. You can enter the material document no of the return receipt and the data gets copid and you can copy into RG23D.
    How do I handle returns at factory?
    There are no D3 procedures at the moment which is mandated by the excise department. Legally you can take credit for all the receipts and then pay the duty when it goes out after repair or to another customer. You can Excise invoice without PO route to take the credit.
    When I do excise invoice creation, the system issues a message not enough balance. Why?
    This does not happen any more. There was a need felt that we should check the balance s even though we can pay the duty 15 days hence.
    I am not able to save the excise invoice text?
    You need to check the object type for the object id J1IN. this can be done by checking the data of the view J_1IVTTXOB. The editor mode has to be set as ‘Application text with SAVE key ‘.
    How can I include more text ids for the excise invoice?
    You can use the CIN IMG text maintenance option and add more ids with descriptors. For excise invoice creation the object is J1II. For depot receipts the object is J1IG and for depot sales it is J1IJ.
    Where does the excise invoice get the business area from?
    Excise invoice does not allow entry of business area. The business area in the billing document is automatically taken for the excise invoice.
    Where does the excise invoice get the profit center from?
    Excise invoice picks up the profit center from the billing document if it is available there. If it is not available there then it looks at the plant specific material master data and picks up if available.
    What will the system do if I have not received the form at the time of billing?
    The system will first check in the Form type maintenance whether the form is marked as required. This means that the form has to come by the time billing happens. Once you receive the form you need to enter it into the forms data base (J1IU) for the delivery document number. If the form receipt is not maintained then the billing will do a repricing and charge full tax for the particular excise duty.
    How does fortnightly utilization determine the accounts to be posted?
    There is no transaction type for determining the accounts of the fortnightly utilization. The credit account of the transaction type ‘DLFC ‘ is used as the debit account here. For the credit side we pick the debit accounts from the GRPO, EWPO and TR6C transactions. So it is mandatory that whether you use EWPO or not you should have maintained the account determination for all transaction tyes for a given excise group.
    What is transaction type ‘UTLZ’ used for?
    Transaction type UTLZ is used for determining the accounts when a JV is posted with an option of fortnightly payment.
    Can I have my own transaction types?
    Transaction types are used internally by CIN for various pruposes. So you cannot define your wn transaction types. Alternate account assignments can be done using sub transaction types.
    Where does RG1 get the data of packed/loose material ?
    Initially when you upload the balance in RG1 you need to mention the material form. Later the system assumes the same for for the same material code. If you need to dynamically change this then you can make use of the user-exit. A material can be marked either as packed or loose but not both.
    What will batch utilization of modvat do?
    Batch utilization is just an interface that helps you to complete the utilization of a set of documents in one step. This simply triggers individual utilization as a BDC so that the user interaction can be minimized.
    What is the number range used for export excise invoice?
    Export invoices uses the number range object j_1iexcexp where as the local invoices uses the number range j_1iexcloc. Even though customers are free to use the same number series now there is no bar from using separate series.
    Can I create a zero duty excise invoice?
    Zero duty invoices can be created both from sales as wellas using excise invoice other movements based on the business requirement. These invoices do not generate an accounting document.
    Is it possible to cancel an excise invoice with zero duty?
    There is no problem in canceling a zero duty excise invoice.
    Where does the billing document get the account for excise duty payable?
    The account determination rules of R3 billing is used for determining the account for the excise posting line in a billing document. The CIN customization has no role to play here.
    How does the stock transfer get the assessable value from?
    This is got using the condition base value formula. For this to happen you should have maintained the assessable value in CIN master data.
    How do I know whether SD route or mm route is followed for stock transfer?
    You need to check in SPRO – Materials Management – Purchasing – Set up Stock transport order – Assign delivery type/checking. For SD order this will be marked ‘A’
    Based on the route followed how do I create an excise invoice?
    If SD route is followed for stock transfer then you can use J1IIN to create excise invoice. If MM route is used for creating stock transport order then you need to use J1IS for creation of Excise invoice.
    How to configure stock transport order?
    Stock transport order is set up in SPRO- Materials management – Purchasing – Set up stock transport order. Here first you have to define the sales area and the default customer code. You have ato assign the order type to the checking rule. Finally you need to maintain the delivery type for the order type.
    I cannot create a proforma billing document for a replenishment delivery. What has gone wrong?
    Normal R3 setting does not allow a billing document to be created for a delivery type NL. You need to change the customization settings of the item category type NLN so that it becomes relevant for billing.
    When I do a receipt at the depot from my factory how do I give the excise invoice number?
    If the excise invoice already exists in the R3 system then in the detail screen of RG23D receipt you can directly enter the internal document number of the excise invoice. This will automatically allow the entrie challan details to be copied.
    Should I receive the full quantity at depot or transit loss is allowed?
    You can receive some goods in the depot which is less than the dispatched. You have the option to enter the receipt quantity as well as the challan quantity at the time of RG23D receipt.
    I want to calculate the excise duties at the time of export sales. What should I do?
    There is a calculate tax button on the utilization screen of Excise invoice creation.. This option will calculate the taxes for an export invoice.
    Can I use my own layout for printing sales excise invoice?
    Yes. If you are using your own layout then you need ot maintain this in the output determination procedure of billing documents for the output type j1i0.
    Can I use my own layout for printing Excise invoice other movements?
    Excise invoice other movements picks up the report layout from the output type ZEXC which has been maintained against the SD output determination – Sales documents. You can maintain your own layouts here and then they will be used for printing.
    Can I use my own layouts for register printing?
    Yes you can have your own layouts. You need to maintain the same in the CIN customization against the sap script form maintenance.
    Can I change the posting date at the time of fort nightly utilization?
    You can enter the posting date as per which you want the system to do the fortnightly
    posting.
    Should I keep the fi/mm period open at the time of posting fort nightly utilization?
    The current period alone should be open at the time of fortnightly utilization. It is also required that both MM as well as FI periods need to be open.
    When I run fortnightly utilization the system is showing zero balance even though there is some balance in the GL account?
    The balances for utilization are picked up in CIN only when the MM period closing is done for the previous period. For eg. If you r posting date is 5th Dec and the November period is still open system will show zero balance.
    Can I change the document type for the accounting document created at the time of excise invoice creation?
    Document type for excise invoice utilization is defined with in CIN customization at the company code level. You can use your own document type.
    Can I post the fort nightly utilization for individual excise invoices?
    You can post the fortnightly utilization for individual invoices also. System give a message that the CENVAT utilization is already doen. But this is configurable and could be made a warning.
    Can I reverse the fortnightly utilization done?
    No you cannot reverse the posting doen with fortnightly utilization. Simulate option is provided in this option for the user to check whether things are ok so that the chances of error are minimal in the actual run.
    Can I have excise rates more than 100%?
    Yes you can have excise rates higher than 100% since some of the tobacco items carry higher excise rates.
    How do I map the tax classification to form types?
    You can maintain it along with Form type definitions in CIN IMG.
    Can I decide not to generate folio numbers at the time of RG23D creation?
    Yes you can keep the customization option at the Excise group level blank and also you can leave the user-exit open.
    What will happen when I cancel a RG23D selection for sales already made?
    If you are canceling a selection before posting then the RG23D register the record will be removed. But if you have already done the posting then the RG23D record is marked cancelled and the balance in the original invoice is inflated by an equivalent amount.
    Why there is no transaction type for J2IU?
    Transaction type is used for account determination by CIN . This is an internal entity for CIN and has no relevance to the business process. Since there is no account determination need for J2IU there is no transaction type.
    What should be my accounting entry in SD ?
    For Factory Sale
    During Billing Document
    Customer Account Dr.
    Sales Account Cr.
    Cenvat Suspense Account Cr.
    During Excise Invoice Creation
    Cenvat Suspense Account Dr.
    Cenvat payable Cr.
    For TR6C Challan
    PLA Account Dr.
    PLA on hold Account Cr.
    During Fortnightly Utilization
    Cenvat payable Dr.
    Cenvat Account Cr.
    PLA Account Cr.
    For Stock Transfer through SD
    No Accounting entries for Performa Billing Document
    During Excise Invoice Creation
    Cenvat Suspense Account Dr.
    Cenvat payable Cr.
    For TR6C Challan
    PLA Account Dr.
    PLA on hold Account Cr.
    During Fortnightly Utilization
    Cenvat payable Dr.
    Cenvat Account Cr.
    PLA Account Cr.
    1.What is CIN and its Functionality?
    2.What is the current Version on CIN?
    3.What are the Different Pricing Procedure Used in CIN?
    4.CIN is Useful for Which Countries?
    5.What are VAT,Service Tax,Educational Cess Conditions Types used in CIN?
    6.Where would we difine the Tax Code and is it a country Specific?
    7.Where will you difine different Tax Rates like 1 %,4 %,12 % etc?
    8.What are the Different Registers Used In CIN?
    9.What are the Different Indian Transaction Code Related to CIN.
    Regards

  • Maximum Retail Price

    Dear Gurus,
    Is SAP CIN have this functionality? If yes then how it's function? How to capture Maximum Retail Price in PO? What configuration is required? Any standard report / form (eg: PO form or Sales invoice) display MRP information??
    Appreciate any help here
    Rgds
    USN

    Dear Lekhram,
    I can see in J1IEX under "Miscelenious" tab there is a MRP indicator but no sure how it function. 
    Marketing will determine the Maximum Retal Price (MRP) and this information need to print in the  PO form and send to vendor so that they able to have a product label with MRP info. And also would like to have control which the selling price should not above MRP and the MRP should print in Sales Invoice too.
    Pls advise
    Rgds
    USN

  • Multiple Word Strings Using C++ in Xcode 2.2

    This is my first post and I'm happily a new member and hopefully a helpful one as well. I took a C++ programming class in school, decided to use Xcode and start doing programming again. However, I have this issue:
    I'm trying to use a string to read me what I've entered for the name of a person, of course once there is a space, the name ends. Here is my code...
    int main()
    int loannumber;
    string name;
    cout << "May I have your loan number please? ";
    cin >> loannumber;
    cout << "Your loan number is " << loannumber << endl;
    cout << "May I have your name please? ";
    cin >> name;
    getline (cin, name);
    cout << "Hello " << name << ".\n";
    Whenever it asks me for the name, I put the first and last name and it will only read the last name back to me.
    How can I get multiple word strings in C++ code? Can someone help me?
    Thank you!!

    Hi--
    Welcome to the Apple Discussions.
    You can do it if you rewrite your code something like this:
    #include <iostream>
    using namespace std;
    int main (int argc, char * const argv[]) {
    char ca[100];
    cout << "May I have your name please?\n";
    cin.getline(ca, 100);
    cout << "Hello " << ca << ".\n";
    return 0;
    }I got this tip from this page, which I found with a Google search. I really don't use C++, though, so I'm not exactly certain that's the "correct" way to go about doing this...
    charlie

  • Use several instances of a dll, each having its own memory

    Hello,
    is it possible to use the CallLibraryNode to load several instances of a dll but each of it should have its own memory space?
    For CINs, there are functions like GetDSStorage and SetDSStorage which provide private memory for each instance of a CIN.
    These functions doesn't seem to work in Dlls.
    Is there something similar available for Dlls?
    Thank you.
    Christian

    ChristianEC wrote:
    Hello,
    is it possible to use the CallLibraryNode to load several instances of a dll but each of it should have its own memory space?
    For CINs, there are functions like GetDSStorage and SetDSStorage which provide private memory for each instance of a CIN.
    These functions doesn't seem to work in Dlls.
    Is there something similar available for Dlls?
    Thank you.
    Christian
    You need to have the DLL provide that functionalty explicitedly. Not by loading the DLL multiple times but by functionality that allocates a memory block to contain the local data of that instance and deallocate it afterwards. If you know C++ you basically would implement an object that is the instance of your operation/data.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Patch needed for uploading sap ecc 6.0 country india version

    Hello experts,We are facing problems whileworking with the cin module,First of all i would like to convey that our server is based at jakarta and that the license is based at jakarta(indonasia),however the off shore delivery centre is based at india,so please guide us like what patches are needed to be uploaded so that we can operate the cin version.
    Functional error----- The error or problem been faced by the functional consultants is that while entering the FTXP tranction the respective fields are always in the display mode and not allowing to enter any data(only single session been opened and not the case of multiple session in the same tranction),
    pls guide,thanks in advance,
    Anshuman.

    Thanks guys for your replies.
    Uday,
    Is there any Authorization object that will let me download ECC IDES?. I  dont see any such object ( named ECC or similar) assigned to my SID in Serv Mkt Place.
    Could that be the reason?. Pls advise.
    JD
    >
    uday kumar wrote:
    > Hi
    >
    >
    All corrective software packages, for SAP NetWeaver 7.0 and SAP Business Suite 2005 and beyond that are delivered after April 2nd, 2007 will ONLY be available via SAP Solution Manager's Maintenance Optimizer. Find more details here
    > Its applies for only support packs and SP stacks you can download Software packaged irrespective of solution mangaer directly
    >
    >
    Sorry if its a repeat question. I need ur help. I was trying to download SAP ECC 6.0 IDES from SAP service market place. I identified all the files needed for ECC 6.0 IDES version installation, added them to download basket, though they wont show up there
    > R u sure that you have added them to download basket,do you have proper authorization to download them to download manager,cross check the setting of download manager and your S userid and password.
    >
    >
    I have Serv Mkt place ID and is there anything else that I need to install first to be able to download IDES files?.
    > Did you configure downlaod manager at your desktop or forntend server?
    >
    > Regards
    > Uday

  • How do I use the WriteToMemoryXX functions in a CIN?

    I'm getting a linker error "unresolved external reference _WriteToMemory16" when I compile the C code that contains the calls to the WriteToMemory16 function. I've installed the accesshw files and am including the accesshw.h file in my C-code CIN. It would seem that I need to compile-in the code for the WriteToMemory function, which I assume resides in accesshw.c.
    My application calls for some direct hardware i/o that falls in the "too messy to do in a block diagram" catagory. I'm using Labview 5.1.1 and talking to a Keithley Metrabyte PIO-96 card.
    Thanks very much for any assistance.

    Ben,
    Thank you for the response. I looked at the examples you mentioned, but unfortunately I'm still unsure what to do. As mentioned, I downloaded the accesshw.zip file and installed the files in order for me to use InPort and OutPort VIs in my program on an NT box, which I'm doing and is working fine. Also, I downloaded the example, "PCI-DIO using AccessHW_DLL.c". This C file contains calls just like the ones I want to use (calls to WriteToMemoryXX) in my CIN C code to basically do the same operations as are done by the InPort and OutPort VIs. Is there a makefile available for that C file? Maybe if I knew how to build that file into a CIN, it would be the same process for me to build my file into a CIN. There is an include file in the "PCI-DIO using AccessH
    W_DLL.c" file that I don't have (ansi_c.h), but I don't get a compiler error when not including this file in my C file so
    I assume I don't need it. I've got the accesshw.dll file in the same directory as my .c file, as instructed to do on the accesshw.zip download page.
    I'm developing the CIN using MSVC++ 4.0 if that helps.
    Thanks very much,
    Jeff

  • SAP defined function modules for developing CIN.

    Hi Experts,
                     Please any one tell me the Function modules developed by SAP to implement CIN. Thanks in Advance.
    Thanks and Regards
    Srihari.

    I found out the solution.

  • Can a C++ sub-program invoked as a cin node call a LabView sub-vi as a "function"

    The subject says it all, we have a mostly LabView system that controls a numerical
    simulation program. We would like to add a new numerical analysis package written
    in C. To be used as written this C package must call one of our LabView sub-vi's
    as a function numerous times. Can this be done?
    -thanks

    > The subject says it all, we have a mostly LabView system that controls a numerical
    > simulation program. We would like to add a new numerical analysis package written
    > in C. To be used as written this C package must call one of our LabView sub-vi's
    > as a function numerous times. Can this be done?
    >
    CINs are one way of doing this, but they are C code written specifically
    for LV.
    A better solution is to use the Call Library Function node, or the DLL node.
    Your C code may already be built into a DLL. If not, it is easier and more
    familiar to the people doing it.
    Another option is to use a built EXE and the System Exec node. Note
    that a
    DLL has multiple entrypoints that can be called at different times to provide
    lots of flexibility. An EXE has few, typically o
    ne, entrypoint and is sort
    of difficult to control once it is up.
    Another option, if the C code is written this way already is to use an
    automation interface -- an ActiveX interface. This is really about the
    same as a DLL, but it follows certain standards so that ActiveX client
    programs can access things in a standard way.
    Be sure to look at the Code Interface or external code manual. It should
    be a pdf manual in the help directory.
    Greg McKaskle

  • Exit from CIN within Error Handling Sub-Function

    I have a CIN which has the code divided betwee the CINRun() function, a number of other functions & a #included .C file. I want to put some error handling into my CIN, so if an error occurs I want execution to return from the CIN to LabVIEW immediately... however, my error handling is currently done in one of the other functions, and may be called from CINRun,
    functions, or the #included .C file. Is there any neat/handy/nice way of universally/globally breaking out of or bombing out of the CIN if the error handling code gets called?

    Michael.Johnson wrote:
    I have a CIN which has the code divided betwee the CINRun() function, a number of other functions & a #included .C file. I want to put some error handling into my CIN, so if an error occurs I want execution to return from the CIN to LabVIEW immediately... however, my error handling is currently done in one of the other functions, and may be called from CINRun,
    functions, or the #included .C file. Is there any neat/handy/nice way of universally/globally breaking out of or bombing out of the CIN if the error handling code gets called?
    You seem to want to do structured ecxeption handling. This however is something only really supported by C++ and other object oriented languages. Standard C can do that only with quite some header macro magic and in general is done in a way, patented by Borland, if I remember correctly. To make things more complicated, writing CINs in C++ is not supported by LabVIEW and requires quite some knowledge about your specific compiler environment and linker to get it right on your own, and no NI won't support C++ creation of CINs.
    You will prabably have to modify your C code quite a bit to get it the way you want. Considering that you will have to make more or less involved changes to your C code anyhow, I would recommend you look into creating a shared library instead and calling that through the Call Library Node. CINs are from the past and support for them will be getting less and less with time as it adds almost no advantages to shared libraries anymore and has some disadvantages in comparison, such as proprietary solution, difficult to support and possible compatibility issues in the future.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • CIN Functionality difference between 4.6C to ECC 6.0

    Dear Friends,
    I  need to analyze the difference of main functionality difference with regards to CIN topics from 4.6C and ECC 6.0.
    Currently my company is using CIN 40A  
    Please help me with your input on this topic.
    If possible send me any kind of documents.
    Your help will be much appreciable.
    Regards
    Plats

    Hi
    Please check this for differences.
    http://solutionbrowser.erp.sap.fmpmedia.com
    regards
    Srinivas

  • " getline(cin,stream) "  gives segmentation fault error

    Hi
    In our application, we have a client and a server. Client and server communicate from network with inetd services. server listens the port with fd_set and get the the string with " select " as a command line argument. everything looks fine in communication but when the client sent a string over the network and server tries the read with getline(cin,stream ), application throws a segmentation fault error.
    Code:
    struct timeval t;
    t.tv_sec=60;
    t.tv_usec=0;
    fd_set rset;
    FD_ZERO(&rset);
    FD_SET(STDIN_FILENO, &rset);
    if(select(2, &rset,NULL,NULL,&t) == 0)
    return NULL;
    getline(cin, stream); *//application crashes here*
    How can we solve this error ?
    thanks for your kindly answers.
    regards
    aykut

    Aykut wrote:
    Thanks for your addressing Andrew. i have already tried it. nothing have changed. well, i have read SunStudio11_Cpp_UserGuide and applied what it says. i think, my error is not related with standart compiler. this caused by 3rdparty tools. i am working on them right now.It's quite possible that your 3rd party tools are causing your problem, but given the dependencies between the C++ run-time libraries and the thread library, the link statement you provided earlier still has problems:
    /sunpro/11/bin/CC -xildoff /dev_obj/users/src/project/sample.o -L/dev_obj/users/src/lib -lcommonCode -L/3rdparty/sybase/ebf10536/lib -lblk_r -lct_r -lcs_r -lcomn_r -ltcl_r -lintl_r -L/usr/lib -lCstd -lnsl -ldl -lthread -lposix4 -lintl -lresolv -lsocket -lc -lcrypt -L/usr/perl5/5.00503/sun4-solaris/CORE -lperl /usr/perl5/5.00503/sun4-solaris/auto/DynaLoader/DynaLoader.a -L/3rdparty/roguewave/SUNPRO60/12s/lib -lctl12s8 -ldbt12s8 -ltls12s8 -L/3rdparty/roguewave/SUNPRO60/12s/lib -lstd12s8 -o /dev_obj/users/src/project/sampleYou should remove "-L/usr/lib -lCstd" from your link step, and probably "-lc" also.
    Also, your compile steps include the "-staticlib=libC" option, but your link step does not. That may or may not cause problems. You can try adding it to your link step, but try that after removing the extra library options, because that option probably does nothing when supplied to a compile-only step.
    Finally, what patch level are patches 108434 and 108434 at? The latest versions of those patches are 108434-24 and 108435-24:
    http://developers.sun.com/sunstudio/downloads/patches/ss11_patches.html
    In my experience, the patch levels have a huge impact on C++ run-time issues. Note that there are dramatic dependencies on the levels of those patches. Do not compile on a machine at 108434-24 and try running on a machine at 108434-14, for example. All your machines pretty much must be at the same patch level for these series of patches.
    If none of that works, and you can't isolate the problem to your third-party tools, you can try using the newer thread library, located in /usr/lib/lwp and /usr/lib/lwp/64, IIRC (I don't have access to a Solaris 8 box right now to check). You can add "-R/usr/lib/lwp" to your link statement and pick up the newer thread model.
    You should also explore upgrading Solaris. Solaris 8 is pretty much no longer supported and as you're finding out, there are some rather intricate dependencies under Solaris 8 that Sun really did a good job removing in Solaris 9 and especially Solaris 10.

  • Is there ARE-1 & ARE-3 functionality in 4.6c CIN version?

    I am working on the roll out of 4.6c.I am facing one problem in CIN.
    1.   In SPRO ,"Settings under Export regulation" is missing.
    2.   Excise transaction types (ETT) are not present in CIN: ARE1,ARE3
    3.   J1IBN01- Creating Excise Bond.
    4.   J1IA101- ARE 1Create/Change/Update.
    5.   J1IA301: ARE3 Create/change/Update.
    Many other transactions which are supporting these transaction are not present.
    can any body tell me that whether these functionalities are present in $.6 c CIN version.
    Regards
    Sunil Garg

    Hi Sunil,
    I am struggling with the same issue. I am not sure if this has anything related to installation problems of CIN 40A on SAP 4.6C.
    If I get a solution I will reply... alternatively if you get a solution please email me on [email protected]
    Thanks & Regards
    Manish

Maybe you are looking for

  • My iPhone 4s is no longer working.

    My iPhone 4s is no longer working. It kept turning off and on on it's own and i tried to restore it. I pressed the lock and home button. I connected it to itunes as it says. Once in itunes it says the iPhone is on recovery mode and then when it is su

  • How do i read a PDB file on my computer?

    How do i read a PDB file on my computer? Ive downloaded a PDB book and id like to view it directly through my laptop. what software would i need? thks Post relates to: Palm TX

  • 'Send to Color' Problem

    I have just installed FinalCutStudio2 and am trying to use the File>send to color command, (on a sequence) It looks like it's working, color loads and goes to open BUT as soon as it opens it closes in the blink of an eye with no error message or cras

  • Displaying new custom field in

    hi all expert again! i created a new field in order.jsp. but i have no idea how to display this new field with value in orderstatusdetail.jsp, which user click on history link on the right side. this value should be collected from FM or extension tab

  • Capacity Plannig Secenario

    Hey, I have an issue related to under-utilization of the capacity We have four mills (Work centers). Only two of the four mills are staffed (for only 1 shift a day), and the other two mills are idle, production of finished goods carry a high overhead