Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
currently I am working on a requirement in c++ where I will be reading text file which have inputs like
AB,
ABX,
ABY,
ABZ,
CD,
CDX,
CDY,
CDZ

so for above two set of inputs 'AB' & 'CD' is unique in each set.

all these inputs I am collecting in an array and further passing to a function which is written in API which is not exposed , So API Function is returning output for mostly input which need to write in a csv like

1.Input-'AB',o/p of 'AB',o/p of 'ABX',o/p of 'ABY',o/p of 'ABZ'
2.Input-'CD',o/p of 'CD',o/p of 'CDX',o/p of 'CDY',o/p of 'CDZ'

and inputs for which I am not getting outputs they should be written as blank.

What I have tried:

This I am able to achieve with the help of running loops & write it in csv but I am facing the challenge for the inputs for which API function is not returning value . Now I am thinking to collect all the inputs in a Vector. The output I will collect in a Map by passing it to the API function will compare the input and output data structure to generate the output csv file. Am I in the right direction to achieve this or I should try any other approach?
Posted
Updated 2-Feb-17 21:49pm
v2
Comments
CPallini 3-Feb-17 2:58am    
Sorry I'm not able to get you. Could you please explain further?
WENzER 3-Feb-17 3:45am    
What you did not understand?

1 solution

You need to fix the code in two places.
1. Fix the API so it returns a recognizable value when an input has no outputs. The obvious value being NULL.
2. Fix your main code so it recognizes the 'no output' value and writes the blank line, or whatever else you desire.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900