
Search In
The malloc is an acronym of "memory allocation". This function allocates the requested size of bytes to a variable and return a pointer of type void.
Syntax:
p=(type cast *)malloc(size)
Here p is a pointer.
Example:
Calculate the sum to element
There are number of ways to get the names of the all the months in the current locale. I am using the Ruby I18n gem which comes along with Rails.
This gem provides number of methods to perform these localisation tasks.
To get the month names you
Passing argument to a function by value is also know as call by value. This method of passing arguments to a function copies the original value of argument into the formal parameter of a function. In other words if we change parameter which are give
Passing argument to a function by reference is also know as call by reference. In this method if we change the parameter given in the function will effect the argument. For passing a value by reference, we use pointers. As we use pointers in call b
The :nth-child selector in CSS code is here it will allow you to select one or more elements according to the formula. It is used to style content based on parent and child relationship.
:nth-child iterates throughs elements from the top of the p
how to show nearest famous places to user location in maps in 50 miles or 100 miles etc.. i was lot searching in google'n but i can't find it could any one help me
#include<stdio.h>
int maxDiff(int a[], int n)
{
int maxDiff = -1; // Initialize Result
int maxRight = a[n-1]; // Initialize max element from right side
for (int i = n-2; i >= 0; i--)
{
if (a[i] > maxRight)
// C++ program to count no of words from given input string.
#include <stdio.h>
#define separator 0
#define word 1
unsigned countWords(char *str) // returns number of words in str
{
int state = separator;
unsigned wc = 0; // word count
w
#include <iostream>
using namespace std;
// Returns true if x is in range [low..high], else false
bool inRange(int low, int high, int x)
{
return ((x-high)*(x-low) <= 0);
}
int main()
{
inRange(10, 100, 25)? cout << "Yes\n":
Main Thread:
When we run a Java program then main thread begins running immediately. It is created automatically. The main thread is the first as well as last thread in a java program to end.
It is the main thread from which other child threa