Primary Difference between C and Ansi C Main difference: C was originally developed by Dennis Ritchie at AT&T Bell Labs between 1969 and 1973. It has a free-format program source code. C is a general-purpose programming language. C is one of the oldest currently used programming languages and is one of the most widely used...
Tech Your iOS App Has To Be IPv6 Ready before 1st June. At WWDC 2015 Apple announced the transition to IPv6-only network services in iOS 9. Starting June 1, 2016 all apps submitted to the App Store must support IPv6-only networking. Most apps will not require any changes because IPv6 is already supported by NSURLSession and CFNetwork APIs. If your app uses...
Primary What does the C ??!??! operator do? ??! is a trigraph that translates to |. So it says: if(a || b){ ... }else{ ... } So, what is digraphs and trigraphs? In computer programming, digraphs and trigraphs are sequences of two and three characters, respectively, that appear in source code and, according to a programming language specification, should be treated as if...
Primary Why in C language is it the case that a[5] == 5[a]? The C standard defines the Array Subscript Operator [] as follows: a[b] == *(a + b) Therefore a[5] will evaluate to: *(a + 5) and 5[a] will evaluate to: *(5 + a) and from elementary math we know those are equal. This is the direct artifact of arrays behaving as pointers, "...
Primary Why isn't sizeof for a struct equal to the sum of sizeof of each member? This is because of padding added to satisfy alignment constraints. Data structure alignment impacts both performance and correctness of programs. Here's an example using typical settings for an x86 processor (all used 32 and 64 bit modes): struct X { short s; /* 2 bytes */ /* 2 padding bytes */ int i;...
Primary Why is one loop so much slower than two loops? Suppose a1, b1, c1, and d1 point to heap memory and code has the following loop. const int n=100000; for(int j=0;j<n;j++){ a1[j] += b1[j]; c1[j] += d1[j]; } This loop is executed 10,000 times via another outer for loop. To speed...
Primary Why is processing a sorted array faster than an unsorted array? Here is a piece of Visual C++ code that seems very peculiar. For some strange reason, sorting the data miraculously makes the code almost six times faster. #include <algorithm> #include <ctime> #include <iostream> int main() { // Generate data const unsigned arraySize = 32768; int data[arraySize]...
Primary What is the difference between #include <filename> and #include “filename”? The difference is in the location where the preprocessor searches for the included file. For #include "filename" the preprocessor searches in the same directory as the file containing the directive. This method is normally used to include programmer-defined header files. For #include <filename> the preprocessor searches...
Primary What are the differences between a pointer variable and a reference variable? * A pointer can be re-assigned: int x = 5; int y = 6; int *p; p = &x; p = &y; *p = 10; assert(x == 5); assert(y == 10); A reference cannot, and must be assigned at initialization: int x = 5; int y = 6; int &r = x; * A pointer has its...
Primary What is the name of the "-->" operator? Here's an example: #include <stdio.h> int main() { int x = 10; while( x --> 0 ) // x goes to 0 { printf("%d ", x); } } Answer --> is not an operator. It is in fact two separate operators, -- and >. The conditional's...
Tech Windows 10 Free Upgrade Offer to End Soon The free upgrade offer to Windows 10 was a first for Microsoft, helping people upgrade faster than ever before. And time is running out. The free upgrade offer will end on July 29 and we want to make sure you don’t miss out. After July 29th, you’ll be...
Swift Introduction to Swift - Swift Programming Language Swift is a new programming language for iOS, OS X, watchOS, and tvOS apps that builds on the best of C and Objective-C, without the constraints of C compatibility. Development on Swift was begun in July 2010 by Chris Lattner, with the eventual collaboration of many other programmers at Apple....
Downloads Download Swift for Windows Swift is a general-purpose, multi-paradigm, compiled programming language created for iOS, OS X, watchOS, tvOS and Linux development by Apple Inc. -------------------------------------------------------------------------------- Update - 22 SEPTEMBER 2020 From 22 September 2020, the Swift project introduced new downloadable Swift toolchain images for Windows [https://swift.org/blog/swift-on-windows/]. These images contain...
Tech Increase your Google AdSense earnings with new Page-level ads Google AdSense launch the new kind of type called page-level ads. These Page-level ads introduced now allow you to optimize ad income on high-end mobile devices. As per google, Page-level ads are a family of ad formats that offer a new and innovative way for you to monetize your content....
Wiki Git Cheat Sheet (Git Commands) Git [https://git-scm.com/] is a version control system that is widely used for software development and other version control tasks. It is a distributed revision control system with an emphasis on speed, data integrity, and support for distributed, non-linear workflows. Git was initially designed and developed in 2005 by...