Primary

Primary Insider is a collection of articles on different topics and programming languages for student programmer such as C, C++, Java, Tech News and other topics.

C Language Style Guide

This style guide is different from others you may see, because the focus is centered on readability and understandability. 1. Variable and method/function 1.1. Variable and method/function names that contain multiple characters must not start with an uppercase letter. Further, each "word" within a variable name should ...

Compile C program with gcc compiler on Bash on Ubuntu on Windows 10

The GNU Compiler Collection (GCC) is a compiler system produced by the GNU Project supporting various programming languages. You can compile a C program by using the gcc command in Windows 10 Bash on Ubuntu. 1.Enable Bash on Ubuntu on Windows 10 If you don't have a enable Ubuntu ...

Graphics (graphics.h) - C Programming

Graphics programming in C used to drawing various geometrical shapes(rectangle, circle eclipse etc), use of mathematical function in drawing curves, coloring an object with different colors and patterns and simple animation programs like jumping ball and moving cars. 1. First graphics program (Draw a line) #include<graphics.h& ...

Introduction to C++ - C++ Programming

1. What is C++? C++ (pronounced "see plus plus") is a programming language began as an expanded version of C. The C++ were first invented by Bjarne Stroustrup in 1979 at Bell Laboratories in Murray Hill, New Jersey. Bjarne Stroustrup initially called the new language "C with Classes." However, in ...

Lesson 10: Stopping and Restarting an Activity

Properly stopping and restarting your activity is an important process in the activity lifecycle that ensures your users perceive that your app is always alive and doesn't lose their progress. There are a few of key scenarios in which your activity is stopped and restarted: The user opens the Recent ...

Lesson 9: Pausing and Resuming an Activity

During normal app use, the app sometimes loses focus, causing the activity to pause. For example, when apps run in multi-window mode, only one of the apps has the focus at any time; the system pauses all other apps. Similarly, when a semi-transparent activity opens (such as one in the ...

Lesson 8: Starting an Activity

Unlike other programming paradigms in which apps are launched with a main() method, the Android system initiates code in an Activity instance by invoking specific callback methods that correspond to specific stages of its lifecycle. There is a sequence of callback methods that start up an activity and a sequence ...

Preprocessor Directives - C Programming

The C preprocessor is a macro processor that is used automatically by the C compiler to transform your program before actual compilation (Proprocessor direcives are executed before compilation.). It is called a macro processor because it allows you to define macros, which are brief abbreviations for longer constructs. A macro ...

Lesson 7: Supporting Different Platform Versions

While the latest versions of Android often provide great APIs for your app, you should continue to support older versions of Android until more devices get updated. This lesson shows you how to take advantage of the latest APIs while continuing to support older versions as well. The dashboard for ...

Lesson 6: Supporting Different Screens

Android categorizes device screens using two general properties: size and density. You should expect that your app will be installed on devices with screens that range in both size and density. As such, you should include some alternative resources that optimize your app’s appearance for different screen sizes and ...