![]() ![]() If you replace your allocation with new with struct Employee *eArr = malloc (n * sizeof *eArr) then you have a pure C program. ![]() ![]() What you have is a C program that uses new instead of malloc for allocation. or see which input appears to be skipped)Īlso, you should pick either C or C++. Try entering an invalid input for either Age or Salary with your current code and see what happens (have your fingers hovering over Ctrl+c when you do. I am not sure if what I'm doing is right.Įmployee* inputEmployee(struct Employee *emp, int n, int index) įputs ("error: invalid floating-point input.\n", stderr) ĮArr = emp /* simply assign struct to element */ When I get to the part of typing the employee name I get the following message "Process exited after 4.017 seconds with return value 3221225477".Ĭould someone please suggest a solution or explain what is wrong with my code. I want to pass the user input to the inputEmployee function by address, save it in an array then display it. I am new to C++ and I am trying to write this simple code where I input and display employee data. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |