Skip to main content

List application

To illustrate the use of those functions, here is an example.



#include <stdio.h>
#include <stdlib.h>
#include "list.h"

LINK string_to_list(char []);
void print_list(LINK);
int count_rec(LINK);

int main(void)
{
        LINK h;

        h = string_to_list("ABC");
        printf("The resulting list is\n");
        print_list(h);
        printf("\nThis list has %d elements.\n", count_rec(h));
        return 0;
}

The output of the program is



The resulting list is
A --> B --> C --> NULL
This list has 3 elements.

Comments

Popular posts from this blog

Architecture Complexity

Here are the items to consider: Coding to an interface Service Oriented Architecture Automated Testing Domain Driven Design Custom Data Access Layer Layered architecture Complexity is relatively equal the number of lines of code. Note that complexity is not bad. It must be justified.

Android Studio:Unknown Host Error

After installing Android Studio, I got the following error: Unknown host 'services.gradle.org'. Please ensure the host name is correct. If you are behind an HTTP proxy, please configure the proxy settings either in Android Studio or Gradle. Consult IDE log for more details (Help | Show Log) Solution File --> Settings --> HTTP Proxy --> Auto-detect proxy settings