Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
/********* Pleasedontcode.com ********** Pleasedontcode thanks you for automatic code generation! Enjoy your code! - Terms and Conditions: You have a non-exclusive, revocable, worldwide, royalty-free license for personal and commercial use. Attribution is optional; modifications are allowed, but you're responsible for code maintenance. We're not liable for any loss or damage. For full terms, please visit pleasedontcode.com/termsandconditions. - Project: "Linked List" - Source Code NOT compiled for: Arduino Uno - Source Code created on: 2024-11-08 04:29:34 ********* Pleasedontcode.com **********/ /****** SYSTEM REQUIREMENTS *****/ /****** SYSTEM REQUIREMENT 1 *****/ /* This Arduino project focuses on integrating */ /* sensors and actuators to create an automated */ /* system, enhancing functionality through responsive */ /* programming and reliable performance. */ /****** END SYSTEM REQUIREMENTS *****/ /* START CODE */ /****** DEFINITION OF LIBRARIES *****/ #include
// Include Arduino library for Arduino functions struct node { int data; struct node* link; }; struct node* head; struct node* current; /****** FUNCTION PROTOTYPES *****/ void setup(void); void loop(void); void setup(void) { // Initialize the linked list with nodes head = (struct node*)malloc(sizeof(struct node)); // Allocate memory for head head->data = 45; head->link = NULL; current = (struct node*)malloc(sizeof(struct node)); // Allocate memory for current current->data = 98; current->link = NULL; head->link = current; current = (struct node*)malloc(sizeof(struct node)); // Allocate memory for another node current->data = 3; current->link = NULL; head->link->link = current; // The following lines are commented out because they are not compatible with Arduino // struct node *ptr; // ptr = head; // current = malloc(sizeof(struct node)); // Missing closing parenthesis // Serial.print("data want to insert="); // Use Serial for output // while (!Serial.available()); // Wait for user input // int x = Serial.parseInt(); // Read integer from Serial // current->link = NULL; // Missing semicolon // struct node*ptr, // Duplicate declaration // ptr = head; // while(ptr->link != NULL) // Incorrect spacing // { // ptr = ptr->link; // } // ptr->link = current; } void loop(void) { // put your main code here, to run repeatedly: } /* END CODE */
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)