Home > Back-end >  Using pointer insert data in the one-dimensional orderly array, in which after insert an arbitrary i
Using pointer insert data in the one-dimensional orderly array, in which after insert an arbitrary i

Time:12-08

C: by the pointer method insert data in the one-dimensional orderly array, asked to insert in it after an arbitrary integer sequence is orderly,

CodePudding user response:

The most primitive way:
Defines a pointer to the same type, first determine the original pointer to the current value is not NULL, and insert data comparison, if than inserting data is large, it is ascribed to insert the number, and then in turn number copied to the rest of the new pointer, data is orderly;
  • Related