Ranjith wrote a new post, Cyber Cafe Management System 11 months, 2 weeks ago
Ranjith wrote a new post, C program for sorting a Linked List 11 months, 2 weeks ago
C program for sorting a Linked List.
#include
#include
#include
#include
void main (int argc,char * argv[])
{
DIR * directory_pointer;
struct dirent* entry;
struct File list
{
char […]
Ranjith wrote a new post, VHDL program for 2 – 4 Decoder 11 months, 3 weeks ago
Ranjith wrote a new post, VHDL program for 4-BIT Parallel Adder 11 months, 3 weeks ago
Ranjith wrote a new post, VHDL program for Inverter Logic gate 11 months, 3 weeks ago
Ranjith wrote a new blog post: How to convert List to long[] or vise versa? 1 year, 4 months ago
There is no automatic conversion from array of primitive type to array of their boxed reference types or vise versa. You have to iterate for each data. Converting List<Long> to long output = new long; int index = 0; for(Long val : input) { indexess = val; index++; } Converting long input = getSomeLongs(); // Assume some [...]
Ranjith wrote a new blog post: How to use Enum in C? 1 year, 4 months ago
In C and C++, enum types can be used to set up collections of named integer constants. Consider a set of all days. #define Sunday 0 #define Monday 1 #define Tuesday 2 #define Wednesday 3 #define Thursday 4 #define Friday 5 #define Saturday 6 The above lines can be replaced by: enum AllDays{Sunday, Monday, Tuesday, [...]
Ranjith wrote a new blog post: How to use bool in c? 1 year, 4 months ago
There is no bool data type in C. In C99 standerd version, the boolean variable has been added as _Bool. Additionally, a new header stdbool.h has been added for compatibility reasons. This header allows programmers to use boolean types in the same way, as in C++ language. To use bool in C, we can use [...]
Ranjith wrote a new blog post: Predict the output or error(s) of the following c code 1 year, 8 months ago
void main()
{
int const * p=5;
printf(“%d”,++(*p));
}
Compiler error: Cannot modify a constant value.
Explanation:
p is a pointer to a “constant integer”. But we tried to change the value of the “constant integer”.
Ranjith wrote a new blog post: How to resize image using php? 1 year, 8 months ago
Here is a simple script to resize the given image. This requires PHP5, GD library.
First download the file and include to your code.
Usage example:
resizeImage(200, 200, ‘crop’);
// *** 3) Save image
$resizeObj -> saveImage(‘sample-resized.jpg’, 100);
?>
Ranjith wrote a new blog post: How to Extract or Unzip files from a .zip file using PHP 1 year, 8 months ago
Here is the simple code which will extract a zip file. Here we are using pclzip.lib file to extract files. You no need to install any other library to your server. First download pclzip.lib file. Now use the below code to extract your zip file. unzip | electrofriends.com extract() == 0) { echo ‘Error : ‘ . [...]
Ranjith wrote a new blog post: How to upload image to database using PHP/MySQL 1 year, 8 months ago
Here is the simple code to upload files to a particular folder also this will make an entry in database. For example if you are making user registration, this code can be used to store user photo. Use the same user table to store user image. In this code we have used “file_tbl” table to store [...]
Ranjith wrote a new blog post: How to convert Digits or numbers to word using PHP? 1 year, 8 months ago
Here is the code to convert digits to word using PHP Example: 564 : five hundred sixty four 0) $str = $ones . ” hundred”; // do ones and tens if ($y 0) return convertTri($r, $tri+1).$str; else return $str; } // returns the number as an anglicized string function convertNum($num) { $num = (int) $num; // [...]
Ranjith wrote a new blog post: How to get image source from file using PHP 1 year, 8 months ago
Use preg_match_all to get the image source from your file.
PHP code:
< ?php
$content='Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industrys standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a type…[Read more]
Ranjith wrote a new blog post: How to send enquiry or feedback mail using PHP script 1 year, 8 months ago
The PHP mail() function is used to send emails from inside a script. Syntax: mail(to,subject,message,headers,parameters) Here is an example of PHP feedback-form which you can directly publish on your website. The example below sends a message to a specified e-mail address. This PHP form includes Name, Email ID, Phone No, Subject, Message. Here…[Read more]
Ranjith wrote a new blog post: How static variable and static functions will work? 1 year, 8 months ago
The keyword static can be used in three major contexts: inside a function, inside a class definition, and in front of a global variable inside a file making up a multifile program. The use of static inside a function is the simplest. It simply means that once the variable has been initialized, it remains in [...]
Ranjith wrote a new blog post: What is the difference between calloc and malloc? 1 year, 8 months ago
1. calloc allocates a block of memory for an array of elements of a certain size. By default the block is initialized to 0. The total number of memory allocated will be (number_of_elements * size). malloc takes in only a single argument which is the memory required in bytes. malloc allocated bytes of memory and not blocks of memory [...]
Ranjith wrote a new blog post: What is function pointer and how to use function pointer? 1 year, 8 months ago
A function pointer is a variable which is used to hold the starting address of a functions and the same can be used to invoke a function. It is also possible to pass address of different functions at different times thus making the function more flexible and abstract. So the function pointers can be used [...]
Ranjith wrote a new blog post: JNI Part 5: JNI Arrays 1 year, 9 months ago
JNI Index Part 1: Introduction and “Hello World” application Part 2: JNI: Visual Studio setup for DLL Project Part 3: Mapping Types and Passing Arguments Part 4: JNI Strings Part 5: JNI Arrays Part 6: JNI Objects Part 7: JNI Arrays of Objects Part 8: JNI Exceptions Part 9: JNI FAQ Part 5: JNI Arrays Arrays have dimension. An…[Read more]
Ranjith wrote a new blog post: JNI Part 4: JNI Strings 1 year, 9 months ago
JNI Index Part 1: Introduction and “Hello World” application Part 2: JNI: Visual Studio setup for DLL Project Part 3: Mapping Types and Passing Arguments Part 4: JNI Strings Part 5: JNI Arrays Part 6: JNI Objects Part 7: JNI Arrays of Objects Part 8: JNI Exceptions Part 9: JNI FAQ Part 4: JNI Strings The jstring type represents…[Read more]
This is the one stop educational site for all Electronic and Computer students. If you want to learn something new then we are here to help. We work on Microcontroller projects, Basic Electronics, Digital electronics, Computer projects and also in basic c/c++ programs.
#Home #Sitemap #Resources #Terms of Use
Copyright©2012 electrofriends.com All Rights Reserved
Contact:info@electrofriends.com