@vijju123 @utkarsh1997 Prompting the user to fill the already created linked list c++

@vijju123
@utkarsh1997

I’m trying to fill the already created linked list by traversing the linked list and then fill each node data with the user input but for some reason after 1040 times it stops asking further values. However let’s say I have link list of size 1000 it will work just fine but for more than size of 1040 It doesn’t prompt the user. I’m not entering value each time I generated random 1100 elements which I’m copying to the console.

inline void myArray<T>::init() {
 Node<T>* temp = head;
T input;
    while(temp!=NULL) {
	cin >> input;
	temp->data = input;
	temp = temp->next;

}
}

If I do something like this, it works just fine doesn’t matter what the size of link list is…

inline void myArray<T>::init() {
 Node<T>* temp = head;
    while(temp!=NULL) {
	temp->data = 5;
	temp = temp->next;

}
}

So, Now I’m thinking the error has something to do with the input taking

Try taking input from file instead of copy pasting so many values to console.

@vijju123 the thing is the grader of this assignment is going to do copy and paste the data :frowning:

I am not sure if command line prompt will allow this large data. I mean, if the second one works just fine, I dont see why first one should give error :frowning:

@vijju123 do you know if there’s any limit of copy pasting data into console?

Because I just entered 1100 input by myself and it did worked

I think there is, thats why I said to try via files.

BTW, 1100 input…you manually entered that?!

1 Like

Well I actually copied 1000 elements because I think the limit is 1040 then I entered 100 input myself (ಥـْـِـِـِـْಥ)

Lol. Such pain :frowning:

Does anyone know how to extend the limit to copy paste the data to console?