It's actually fairly easy to change the email address assigned to your blog. Whatever you do don't delete the blog.
In fact there is no direct option of changing your blogger email address. Blogger provides an option so that you can add authors which helps to add guest authors to be part of your blog. Using this option we can change your login email ID.Follow these steps -
* Login to your blogger account.
* Click on settings.
* Click on Permissions.
* Click ADD AUTHORS
* Enter your new e-mail address, and an activation link will be sent to your new email address.
* Click that. You will be redirected to blogger, then to your blog. Enter necessary details ( if blogger asks ).
* Once authentication is successful. Log-out and Login with your old-email ID and grant admin privileges to your new email ID.
* After that login with your new email ID and remove your old-email ID.
* Click on settings.
* Click on Permissions.
* Click ADD AUTHORS
* Enter your new e-mail address, and an activation link will be sent to your new email address.
* Click that. You will be redirected to blogger, then to your blog. Enter necessary details ( if blogger asks ).
* Once authentication is successful. Log-out and Login with your old-email ID and grant admin privileges to your new email ID.
* After that login with your new email ID and remove your old-email ID.
This is an indirect way of changing your email address as blogger doesn’t have an option to change email address.
Bounce Rate
Today I was going to write about why new websites can display very misleading bounce rates.
What Is Bounce Rate?
Bounce rate is a very important metric for website owners. It basically tells you what percentage of your visitors are “bouncing” away after landing on your site means they just visit one page and leave before clicking on to a second page inside your site. A bounce can occur for several reasons, including:
• The visitor hit the “Back” button on his browser.
• The visitor closed his browser.
• The visitor clicked on one of your ads.
• The visitor clicked on one of your external links.
• The visitor used the search box on his browser.
• The visitor typed a new URL on his browser.
All the actions above would cause the visitor to leave your site. Provided he did any of these actions right after arriving at your site , it would be counted as a bounce. In fact the formula for finding the bounce rate on your website is:
Bounce rate = Visits that left after one page / Total number of visits
For example, if during a certain month your site received 120,000 visits, out of which 80,000 bounced after visiting just one page, your bounce rate for that month would be 80,000 divided by 120,000, which equals to 0.66 (or 66%). Notice that you can calculate the bounce rate of your whole website or of single pages inside it.
Obviously the lower the bounce rate on your website, the better, because it means that visitors are getting engaged by your content and design, and that they are clicking to visit a second third and so on page on your site.
How do you know the exact bounce rate on your site? A web analytics program like Google Analytics will automatically track the numbers for you.
Choose a Nice Topic for your Blog is very important Before you started with any kind of blogging, it’s critical that you think carefully about the topic about which you will write.
If you pick the wrong topic, you might waste time moving toward the wrong direction. Make every attempt to avoid that trap.
Trust me. There’s nothing worse than putting your heart and soul into a project, and never getting rewarded for your efforts.
This post will guide all the way through selecting the nice topic you’d like to dominate. This post will prevent you from getting into the wrong topic.
1. You must have interest on topic
“Probably the best place to start thinking about what your blog should be about is to consider what YOU are about.”
There are two main reasons for this.
Firstly if you want to grow a popular and well respected blog it can take considerable time and you’ll be needing to take a long term approach to building it up.
it makes sense really as no one wants to read something that the author doesn’t really believe in.
2.your topic should be Popular
While the blogger’s interest is important it’s not enough on it’s own to build a popular blog. Another important thing is that people WANT to read information on the topic you’re writing on. According to law of Supply and Demand you must write on that which is most demanding and reader want to read .
3.your topic should be growing
Also keep in mind that popular topics change over time. Obviously it’s great to get on a topic before it becomes big rather than when it’s on the decline. This is not easy to do of course but predict the next big thing that people will be searching for and you could be onto a winner.
4.What competition is there?
One of the traps that some bloggers get sucked into when choosing a topic is to go for the most popular topics with no regard for the competition that they might face in those markets. The chances are if you have identified a niche that you think is ‘hot’ at the moment that someone else will have also. It’s demand and supply coming into play again – for any level of demand for information on a topic there will only be a certain number of sources of that information that will be needed on that topic.
5.Choose that topic in which you have enough Content
One of the key features of successful blogs is that have the ability to continue to come up with fresh content on their topic for long periods of time. Conversely, one of the things that kills many blogs is that their authors run out of things to say.
Do this and once you have clearly defined a nice topic you become totally unstoppable.
Happy Blogging...........
Both tricks can work. Let’s analyze the advantages and disadvantages of each of them.
Advantages of One Blog with Many Categories
The largest advantage of this model is that you will have a very strong domain, since it will receive the link juice from all the different topics and content channels. Over time it will become relatively easy to rank for keywords because of the high trust that the root domain has. That is why websites like Wikipedia or Digg rank so well in Google.
Another advantage of this model is the unlimited potential for expansion. Provided your domain is a generic one, you will be able to add and remove topics over the time without needing to rework the brand.
Disadvantages of One Blog with Many Topics
The main disadvantage of one large blog covering many topics is the fact that it will require a huge amount of time, energy and money to become successful.
Why? Because you would need to shape it as a content portal. That means that you should have a design that supports the portal structure, different channels inside it, and different writers to keep each of the channels updated regularly.
Trying to do a content portal by yourself and with no investment would probably yield mediocre results.
Advantages of Many Blogs with One Topic
The advantage of having many blogs, each with a selected topic, is the fact that it will be easier to attract loyal visitors on each of those sites. The sharper your focus, the easier it is to convince a first time visitor that he should come back tomorrow or subscribe to your RSS feed.
Secondly, selected topic websites are also easier to be monetized.
Disadvantages of Many Blogs with One Topic
The disadvantage of having many blogs, each with a niche topic, is the time and energy that you will need to spend managing them. You will inevitably need to worry about the web hosting, web design, software, maintenance so on. The higher the number of sites you have, the more time they will consume with those tasks.
Additionally, there is always the risk to spread yourself too thin. If you can’t keep up with the content production and promotion activities on all the blogs, they will probably tank over the time.
Conclusion
As you can see there are advantages and disadvantages related to both strategies. Choosing one over the other is a personal decision.
According to me it is good to go with nice blogs. Before selecting the topic of your blog you first confirm that you will not get shortage of content on that topic . For example creating a blog about “Hollywood Movies” would probably not be a good idea. If you choose “Digital Photography,” however, you should be fine.
I also prefer to focus on the development of one website or blog at a time. Trying to do too many things at once is one of the most common business mistakes.
What do you think? Please share by comments
what is a Blog ? That is a good question to ask at the starting of a Blogging for Beginners.
There are alot of answer for this question .
Here are a few definitions from other much wiser people on the ‘what is a blog?’
A weblog is a hierarchy of text, images, media objects and data, arranged chronologically, that can be viewed in an HTML browser..
A frequent, chronological publication of personal thoughts and Web links.
‘From “Web log.” A blog is basically a journal that is available on the web. The activity of updating a blog is “blogging” and someone who keeps a blog is a “blogger.”
A weblog is kind of a continual tour, with a human guide who you get to know. There are many guides to choose from, each develops an audience, and there’s also comraderie and politics between the people who run weblogs, they point to each other, in all kinds of structures, graphs, loops, etc.
A blog is basically a journal that is available on the web. The activity of updating a blog is “blogging” and someone who keeps a blog is a “blogger.” Blogs are typically updated daily using software that allows people with little or no technical background to update and maintain the blog. Postings on a blog are almost always arranged in cronological order with the most recent additions featured most prominantly.
A blog is a website in which items are posted on a regular basis and displayed in reverse chronological order. The term blog is a shortened form of weblog or web log. Authoring a blog, maintaining a blog or adding an article to an existing blog is called “blogging”. Individual articles on a blog are called “blog posts,” “posts” or “entries”. A person who posts these entries is called a “blogger”. A blog comprises text, hypertext, images, and links (to other web pages and to video, audio and other files). Blogs use a conversational style of documentation. Often blogs focus on a particular “area of interest”, such as Washington, D.C.’s political goings-on. Some blogs discuss personal experiences.
This time we will show you how to add the official Twitter tweet button to each Blogger post. This button will let people share your posts without leaving your blog.
The one feature that I like most about Twitter tweet button is that you can choose to recommend up to two Twitter accounts for sharers to follow after they share content from your blog.
It will also automatically shorten the URL using Twitter’s t.co URL shortening service.
I have modified the button’s original code to make it detect the correct post URL and post title even when you click the button on a page that shows multiple posts i.e. home page.
Now let’s install the button:
1-Go to Dashboard > Design > Edit HTML.
2-Back up your template.
3-Tick the Expand Widget Templates check box on top right of the HTML window.
4-Find the following line of code in your HTML, this is the code for your post content:
2-Back up your template.
3-Tick the Expand Widget Templates check box on top right of the HTML window.
4-Find the following line of code in your HTML, this is the code for your post content:
<data:post.body/>
5-Paste the button code immediately below (after) that line:
<!-- Twitter tweet button Start --> <b:if cond='data:blog.pageType != "static_page"'> <div style='text-align:left;padding:5px 5px 5px 0;'> <a class='twitter-share-button' data-count='vertical' expr:data-text='data:post.title' expr:data-url='data:post.url' data-via='BloggerSentral' data-related='' href='http://twitter.com/share'>Tweet</a> <script src='http://platform.twitter.com/widgets.js' type='text/javascript'></script> </div> </b:if> <!-- Twitter tweet button End -->
6-Button configuration
Choose the type of button and follow recommendation by changing the value of the respective attributes in code line 4.
Button type | Attribute | Value |
data-count | vertical | |
horizontal | ||
none | ||
Follow recommendation 1 | data-via | Your Twitter username |
Follow recommendation 2 | data-related | Second Twitter username |
7-Button placement
The steps above positioned the button on bottom left of each post. To change the button position, do the following:
Position it on top of post
Instead of after <data:post.body/>, place the button code before .
8-Preview, you should see the button appear in each post.
9-Click Save if you like what you see.
9-Click Save if you like what you see.
System Restore is a tool of Windows XP Professional that you can use to restore your computer to a previous state, if a problem occurs, without losing your personal data files like Microsoft Word documents, browsing history, drawings, favorites, or e-mail. System Restore tool monitors changes to the system and some application files, and it automatically creates easily identified restore points. These restore points allow you to revert your system to a previous time. They are created daily and at the time of any system events like when any application or driver is installed. You can also create and name your own restore points at any time.
How create system restore point manually .See Here
Before you open the System Restore console, you may want to save your work and close all programs since System Restore requires you to restart your computer.
After restart your computer follow these steps :-
• Click Start.
• Point to All Programs.
• Point to Accessories.
• Point to System Tools.
• Click System Restore.
From the Welcome to System Restore screen of the System Restore Wizard select Restore my computer to an earlier time. Then select the date you created the restore point from the calendar in the Select a Restore Point screen. All of the restore points you created and you computer created on the selected date are listed by name in the list box to the right of the calendar.select one of them and click next.
Step By Step Video for system restore
Note: System Restore does not replace the process of uninstalling a program. To completely remove the files installed by a program, you must remove the program using Add or Remove Programs in Control Panel or the program's own uninstall program. To open Add or Remove Programs, click Start, click Control Panel, and then click Add or Remove Programs.
How create system restore point manually .See Here
Before you open the System Restore console, you may want to save your work and close all programs since System Restore requires you to restart your computer.
After restart your computer follow these steps :-
• Click Start.
• Point to All Programs.
• Point to Accessories.
• Point to System Tools.
• Click System Restore.
From the Welcome to System Restore screen of the System Restore Wizard select Restore my computer to an earlier time. Then select the date you created the restore point from the calendar in the Select a Restore Point screen. All of the restore points you created and you computer created on the selected date are listed by name in the list box to the right of the calendar.select one of them and click next.
Step By Step Video for system restore
Note: System Restore does not replace the process of uninstalling a program. To completely remove the files installed by a program, you must remove the program using Add or Remove Programs in Control Panel or the program's own uninstall program. To open Add or Remove Programs, click Start, click Control Panel, and then click Add or Remove Programs.
In this article we learn how to use the System Restore tool to return your computer to a previous state. System Restore takes a "snapshots" of critical system files and some program files and registry settings and stores this information as restore points. If your computer is not functioning correctly, you can use these restore points to return Windows XP to a previous state when your computer was functioning correctly.
Click Start->All Programs-> Accessories-> System Tools ->System Restore.
For Classic Start Menu: Click Start-> Programs-> Accessories-> System Tools-> System Restore.
Click Create a restore point, and then click Next.
In the Restore point description box, type a name to identify this restore point. System Restore automatically adds to this name the date and time that this Restore Point is created.
To finish creating this restore point, click Create.
See Video Here
Note:-System Restore does not affect personal files, such as e-mail, documents, or photos. You can only restore files that you have deleted if you have made backups of those files. To perform the System Restore, you must be logged on to Windows as an administrator.
Click Start->All Programs-> Accessories-> System Tools ->System Restore.
For Classic Start Menu: Click Start-> Programs-> Accessories-> System Tools-> System Restore.
Click Create a restore point, and then click Next.
In the Restore point description box, type a name to identify this restore point. System Restore automatically adds to this name the date and time that this Restore Point is created.
To finish creating this restore point, click Create.
You can also launch System Restore window by typing the command below, in the RUN box:
%SystemRoot%\System32\restore\rstrui.exe
See Video Here
Note:-System Restore does not affect personal files, such as e-mail, documents, or photos. You can only restore files that you have deleted if you have made backups of those files. To perform the System Restore, you must be logged on to Windows as an administrator.
What are the requirment for installing Windows XP SP 2 in my system?
The hard disk space requirements for Windows XP Service Pack 2:See Here
Do I need to install Windows XP SP 1 before installing the Service Pack 2?
No, Windows XP Service Pack 2 includes SP 1 and it's a direct replacement for Windows XP Service Pack
1. Service packs are cumulative. This means that the problems that are fixed in a service pack are also fixed in later service packs. For example, Windows XP SP2 contains all the fixes that are included in Windows XP SP 1 (SP1). You do not have to install an earlier service pack before you install Windows XP SP2.
Similarly, you don't have to uninstall Windows XP SP 1 before installing Service Pack 2.
List of fixes included in Windows XP Service Pack 2
The hard disk space requirements for Windows XP Service Pack 2:See Here
Do I need to install Windows XP SP 1 before installing the Service Pack 2?
No, Windows XP Service Pack 2 includes SP 1 and it's a direct replacement for Windows XP Service Pack
1. Service packs are cumulative. This means that the problems that are fixed in a service pack are also fixed in later service packs. For example, Windows XP SP2 contains all the fixes that are included in Windows XP SP 1 (SP1). You do not have to install an earlier service pack before you install Windows XP SP2.
Similarly, you don't have to uninstall Windows XP SP 1 before installing Service Pack 2.
List of fixes included in Windows XP Service Pack 2
There are a lot of ways to prints a document, but you can print a document quickly if you put a shortcut to the printer on your desktop and drag a document icon to it, no need to open file for printing just drag a file to printer icon and get your print.
To do this, first click Start button, Settings, then Printers ( first make sure you installed your printer driver). When the Printers window opens, hold down Ctrl and drag the printer icon to your system desktop.
Now you can drag a document icon and drop it in printer icon on your desktop. Here you will get a print quickly and without open a file.
To do this, first click Start button, Settings, then Printers ( first make sure you installed your printer driver). When the Printers window opens, hold down Ctrl and drag the printer icon to your system desktop.
Now you can drag a document icon and drop it in printer icon on your desktop. Here you will get a print quickly and without open a file.
This article lists keyboard shortcuts that you can use with Windows Operating System.
• F1: Help
• CTRL+ESC: Open Start menu
• ALT+TAB: Switch between open programs
• ALT+F4: Quit program
• SHIFT+DELETE: Delete item permanently
• Windows Logo+L: Lock the computer (without using CTRL+ALT+DELETE)
• SHIFT+right click: Displays a shortcut menu containing alternative commands
• SHIFT+double click: Runs the alternate default command (the second item on the menu)
• ALT+double click: Displays properties
• SHIFT+DELETE: Deletes an item immediately without placing it in the Recycle Bin
• General keyboard-only commands
• F1: Starts Windows Help
• F10: Activates menu bar options
• SHIFT+F10 Opens a shortcut menu for the selected item (this is the same as right-clicking an object
• CTRL+ESC: Opens the Start menu (use the ARROW keys to select an item)
• CTRL+ESC or ESC: Selects the Start button (press TAB to select the taskbar, or press SHIFT+F10 for a context menu)
• CTRL+SHIFT+ESC: Opens Windows Task Manager
• ALT+DOWN ARROW: Opens a drop-down list box
• ALT+TAB: Switch to another running program (hold down the ALT key and then press the TAB key to view the task-switching window)
• SHIFT: Press and hold down the SHIFT key while you insert a CD-ROM to bypass the automatic-run feature
• ALT+SPACE: Displays the main window's System menu (from the System menu, you can restore, move, resize, minimize, maximize, or close the window)
• ALT+- (ALT+hyphen): Displays the Multiple Document Interface (MDI) child window's System menu (from the MDI child window's System menu, you can restore, move, resize, minimize, maximize, or close the child window)
• CTRL+TAB: Switch to the next child window of a Multiple Document Interface (MDI) program
• ALT+underlined letter in menu: Opens the menu
• ALT+F4: Closes the current window
• CTRL+F4: Closes the current Multiple Document Interface (MDI) window
• ALT+F6: Switch between multiple windows in the same program (for example, when the Notepad Find dialog box is displayed, ALT+F6 switches between the Find dialog box and the main Notepad window)
• F2: Rename object
• F3: Find all files
• CTRL+X: Cut
• CTRL+C: Copy
• CTRL+V: Paste
• SHIFT+DELETE: Delete selection immediately, without moving the item to the Recycle Bin
• ALT+ENTER: Open the properties for the selected object
folder/shortcut control
• F4: Selects the Go To A Different Folder box and moves down the entries in the box (if the toolbar is active in Windows Explorer)
• F5: Refreshes the current window.
• F6: Moves among panes in Windows Explorer
• CTRL+G: Opens the Go To Folder tool (in Windows 95 Windows Explorer only)
• CTRL+Z: Undo the last command
• CTRL+A: Select all the items in the current window
• BACKSPACE: Switch to the parent folder
• SHIFT+click+Close button: For folders, close the current folder plus all parent folders
• Windows Logo+L: Log off Windows
• Windows Logo+P: Starts Print Manager
• Windows Logo+C: Opens Control Panel
• Windows Logo+V: Starts Clipboard
• Windows Logo+K: Opens Keyboard Properties dialog box
• Windows Logo+I: Opens Mouse Properties dialog box
• Windows Logo+A: Starts Accessibility Options (if installed)
• Windows Logo+SPACEBAR: Displays the list of Microsoft IntelliType shortcut keys
• Windows Logo+S: Toggles CAPS LOCK on and off
• TAB: Move to the next control in the dialog box
• SHIFT+TAB: Move to the previous control in the dialog box
• SPACEBAR: If the current control is a button, this clicks the button. If the current control is a check box, this toggles the check box. If the current control is an option, this selects the option.
• ENTER: Equivalent to clicking the selected button (the button with the outline)
• ESC: Equivalent to clicking the Cancel button
• ALT+underlined letter in dialog box item: Move to the corresponding item
• F1: Help
• CTRL+ESC: Open Start menu
• ALT+TAB: Switch between open programs
• ALT+F4: Quit program
• SHIFT+DELETE: Delete item permanently
• Windows Logo+L: Lock the computer (without using CTRL+ALT+DELETE)
• SHIFT+right click: Displays a shortcut menu containing alternative commands
• SHIFT+double click: Runs the alternate default command (the second item on the menu)
• ALT+double click: Displays properties
• SHIFT+DELETE: Deletes an item immediately without placing it in the Recycle Bin
• General keyboard-only commands
• F1: Starts Windows Help
• F10: Activates menu bar options
• SHIFT+F10 Opens a shortcut menu for the selected item (this is the same as right-clicking an object
• CTRL+ESC: Opens the Start menu (use the ARROW keys to select an item)
• CTRL+ESC or ESC: Selects the Start button (press TAB to select the taskbar, or press SHIFT+F10 for a context menu)
• CTRL+SHIFT+ESC: Opens Windows Task Manager
• ALT+DOWN ARROW: Opens a drop-down list box
• ALT+TAB: Switch to another running program (hold down the ALT key and then press the TAB key to view the task-switching window)
• SHIFT: Press and hold down the SHIFT key while you insert a CD-ROM to bypass the automatic-run feature
• ALT+SPACE: Displays the main window's System menu (from the System menu, you can restore, move, resize, minimize, maximize, or close the window)
• ALT+- (ALT+hyphen): Displays the Multiple Document Interface (MDI) child window's System menu (from the MDI child window's System menu, you can restore, move, resize, minimize, maximize, or close the child window)
• CTRL+TAB: Switch to the next child window of a Multiple Document Interface (MDI) program
• ALT+underlined letter in menu: Opens the menu
• ALT+F4: Closes the current window
• CTRL+F4: Closes the current Multiple Document Interface (MDI) window
• ALT+F6: Switch between multiple windows in the same program (for example, when the Notepad Find dialog box is displayed, ALT+F6 switches between the Find dialog box and the main Notepad window)
• F2: Rename object
• F3: Find all files
• CTRL+X: Cut
• CTRL+C: Copy
• CTRL+V: Paste
• SHIFT+DELETE: Delete selection immediately, without moving the item to the Recycle Bin
• ALT+ENTER: Open the properties for the selected object
folder/shortcut control
• F4: Selects the Go To A Different Folder box and moves down the entries in the box (if the toolbar is active in Windows Explorer)
• F5: Refreshes the current window.
• F6: Moves among panes in Windows Explorer
• CTRL+G: Opens the Go To Folder tool (in Windows 95 Windows Explorer only)
• CTRL+Z: Undo the last command
• CTRL+A: Select all the items in the current window
• BACKSPACE: Switch to the parent folder
• SHIFT+click+Close button: For folders, close the current folder plus all parent folders
• Windows Logo+L: Log off Windows
• Windows Logo+P: Starts Print Manager
• Windows Logo+C: Opens Control Panel
• Windows Logo+V: Starts Clipboard
• Windows Logo+K: Opens Keyboard Properties dialog box
• Windows Logo+I: Opens Mouse Properties dialog box
• Windows Logo+A: Starts Accessibility Options (if installed)
• Windows Logo+SPACEBAR: Displays the list of Microsoft IntelliType shortcut keys
• Windows Logo+S: Toggles CAPS LOCK on and off
• TAB: Move to the next control in the dialog box
• SHIFT+TAB: Move to the previous control in the dialog box
• SPACEBAR: If the current control is a button, this clicks the button. If the current control is a check box, this toggles the check box. If the current control is an option, this selects the option.
• ENTER: Equivalent to clicking the selected button (the button with the outline)
• ESC: Equivalent to clicking the Cancel button
• ALT+underlined letter in dialog box item: Move to the corresponding item
Structs are the userdefined data type. Structs are defined by using the struct keyword in c#.
for example:
It is an error to define a default (parameterless) constructor for a struct. It is also an error to initialize an instance field in a struct body. You can initialize struct members only by using a parameterized constructor or by accessing the members individually after the struct is declared.
This example demonstrates struct initialization using both default and parameterized constructors.
Structs Almost have same syntax as classes, But structs are more limited than classes:
• Within a struct declaration, fields cannot be initialized unless they are declared as const or static.
• A struct cannot declare a default constructor (a constructor without parameters) or a destructor.
• Structs are copied on assignment. When a struct is assigned to a new variable, all the data is copied, and any modification to the new copy does not change the data for the original copy.
• Structs are value types but classes are reference types.
• structs can be instantiated without using a new operator.
• Structs can declare constructors that have parameters.
• A struct cannot support the inheritance.
• All structs inherit directly from System.ValueType, which inherits from System.Object.
• A struct can implement interfaces.
• A struct can be used as a nullable type and can be assigned a null value.
for example:
public struct StructA
{
public int x, y;
public A(int p1, int p2)
{
x = p1;
y = p2;
}
}
{
public int x, y;
public A(int p1, int p2)
{
x = p1;
y = p2;
}
}
It is an error to define a default (parameterless) constructor for a struct. It is also an error to initialize an instance field in a struct body. You can initialize struct members only by using a parameterized constructor or by accessing the members individually after the struct is declared.
This example demonstrates struct initialization using both default and parameterized constructors.
public struct StructA
{
public int x, y;
public StructA (int p1, int p2)
{
x = p1;
y = p2;
}
}
class TestStructA
{
static void Main()
{
// Initialize:
StructA StructA1 = new StructA();
StructA StructA2 = new StructA(10, 10);
// Display results:
Console.Write("StructA 1: ");
Console.WriteLine("x = {0}, y = {1}", StructA1.x, StructA1.y);
Console.Write("StructA 2: ");
Console.WriteLine("x = {0}, y = {1}", StructA2.x, StructA2.y);
// Keep the console window open in debug mode.
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
}
{
public int x, y;
public StructA (int p1, int p2)
{
x = p1;
y = p2;
}
}
class TestStructA
{
static void Main()
{
// Initialize:
StructA StructA1 = new StructA();
StructA StructA2 = new StructA(10, 10);
// Display results:
Console.Write("StructA 1: ");
Console.WriteLine("x = {0}, y = {1}", StructA1.x, StructA1.y);
Console.Write("StructA 2: ");
Console.WriteLine("x = {0}, y = {1}", StructA2.x, StructA2.y);
// Keep the console window open in debug mode.
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
}
Structs Almost have same syntax as classes, But structs are more limited than classes:
• Within a struct declaration, fields cannot be initialized unless they are declared as const or static.
• A struct cannot declare a default constructor (a constructor without parameters) or a destructor.
• Structs are copied on assignment. When a struct is assigned to a new variable, all the data is copied, and any modification to the new copy does not change the data for the original copy.
• Structs are value types but classes are reference types.
• structs can be instantiated without using a new operator.
• Structs can declare constructors that have parameters.
• A struct cannot support the inheritance.
• All structs inherit directly from System.ValueType, which inherits from System.Object.
• A struct can implement interfaces.
• A struct can be used as a nullable type and can be assigned a null value.