c - How to move data from an array to the buffer when a program starts? -
is there way have data in array of characters or integers placed in buffer when programs starts if user has entered data?
for example:
int main() {     int run = 1;     char a[] = "4\nasdfg\0";     char in = null;      datatobuffer(a);//is there command in c?      while (run){         in = getchar();         if (in == '\0')             run = 0;     }     //loop stopped, user didn't }   alternatively, there way in debugger of vs?
this testing several functions rely on user input want automate process of entering data.
edit: not optimal guess i'll different macro program, although isn't practical solution more few dozen of characters since it's slow.
 
 
  
Comments
Post a Comment