C Curly Braces Assignment Satisfaction

Contacts Header File (.h)StructuresOpen the contacts.hfile and copy the structures (Name, Address, Numbers, and Contact) from the file contacts.hin Assignment 1. Be careful not to paste over the helpful comments in the provided contacts.hfile! Numbers Modify the Numbersstructure so that each C stringmember (cell, home, and business) accommodates a 10-digit phone number (ex: “4163331111”). Function Prototypes1.Copy the function prototypes (getName, getAddress, and getNumbers) from the file contacts.hin Assignment 1 (Milestone 4). Again, be careful not to paste over the helpful comments in the provided contacts.hfile! 2.Declare an additional function prototype: voidgetContact(structContact*);This function has one parameter that receives a pointer to a Contact. The details on how this function should work is described in Milestone 2. Contacts Source File (.c)Open the contacts.csource code file. Libraries In order to define the functions that were declared as prototypes in the contacts.hfile, this source file needs visibility of their existence. This is accomplished by including the required header library file. Include the contacts.hheader file (see source code comments). Function Definitions1.Copy the function definitions (getName, getAddress, and getNumbers) from the file contacts.cin Assignment 1 (Milestone 4). 2.Add an emptydefinition for the new function getContact(see the prototype declared in the contacts.hfile) – refer to the source comments for placement. For this milestone you don’t have to define the details for this function (this will be done in Milestone 2) so for now, specify an empty code block: getContact function header goes here… { // Use an open and close curly brace with a blank line }

If you're familiar with placeholders in Zendesk Support, then you already know something about Liquid markup. It's the templating language we use to enable them. Placeholders are used in automations, macros, targets, triggers, and widgets as containers for dynamically generated ticket and user data. What you may not know about Liquid markup is that you can also use it to customize how this data is selected and displayed as output. This is because Liquid also allows you to create simple programming logic such as case statements, if statements, for loops, and so on.

By writing simple control statements directly in the comment/description action in macros and the email user action in automations and triggers, you can accomplish in one automation, macro, or trigger what you used to have to do in multiple automations, macros, and triggers. You can also customize how comment text is presented.

You can find the Liquid documentation at Liquid for Designers. All of the elements of the language are described in detail. Here, however, is a brief introduction to how it works.

Liquid is a templating language for rendering email and HTML. Liquid is the mechanism that enables the automated placement of data in comments and email notifications using placeholders.

There are two types of markup in Liquid:
  • Output, which is text output contained in double curly brackets.
  • Tags, which contain the programming logic that determines how the data is expressed with placeholders.

If you simply equate output with placeholder, you're about half way to understanding what Liquid is and how it's used. What you may not know about Liquid output however is that in addition to expressing ticket and user data, there are also methods available to manipulate text strings and arrays. In Liquid, these methods are referred to as filters. Using a filter you can transform text to uppercase characters, for example. But that's one of the simplest examples of what filters can be used for. See the Liquid documentation for more information.

The other half of understanding of how Liquid can be used comes from knowing what tags are and how they are used. Tags provide the programming logic that you can use to select and present data.

Using Liquid tags you can create:

  • if else statements
  • case statements
  • for loops
  • cycles
  • variable assignments

For more examples of how Liquid markup can be used, see the following articles:

0 Replies to “C Curly Braces Assignment Satisfaction”