Click here to Skip to main content
15,885,201 members

Comments by Aydin Homay (Top 200 by date)

Aydin Homay 22-Nov-18 6:43am View    
Try to write an algorithm first, then go to implementation. Take a pen/pencil no matter ;-) and a paper start writing:
1- Do this,
2- Do this,
3- So on.
Then make a code based on what you wrote this will help you to really understand the problem that you are trying to solve it. This will also make your language more accurate, for example, you are saying that "you want to insert a word into a line" but you are not specifying which line really mean? What is the input of your algorithm what is the expected output and what kind of process will generate such output to your input? these are questions that you need to think and answer clearly.
Btw, the code that you provided sounds to complex for this problem ...
Aydin Homay 22-Nov-18 6:36am View    
Agree Vote 5 ;-)
Aydin Homay 19-Nov-18 17:14pm View    
Krishna you are only presenting one method could you please show how your code exactly look likes? plus rephrase your question is not really clear what you want.
Aydin Homay 19-Nov-18 17:10pm View    
AS far as I know regarding the code that you have provided above you are passing the struct Count to the printCode by value not by reference, could you please make your question more clear what are you trying to achieve?
Aydin Homay 19-Nov-18 6:10am View    
Are you trying to load a file in C++ and search for a word on it?