We should create shared_ptr objects carefully.
Checkout below two cases,
1.) Try not to use same raw pointer for creating more than one shared_ptr object because in that case different shared_ptr objects will not get to know that they are sharing the pointer with any other shared_ptr objects.
How this can create problem?
Suppose 2 shared pointers were created with same raw pointer like this,
Suppose when ptr_2 goes out of scope then it will delete associated raw pointer and then ptr_1 will be pointing to a dangling pointer.
So, when ptr_1 goes out of scope then it will again try to delete the associated memory, which is actually a dangling pointer. Hence program will crash.
Check out below example,
2.)Don’t create shared_ptr object from memory from stack instead of heap.
Checkout below example,
shared_ptr expects that memory associated with it is from heap, therefore when it goes out of scope it deletes the associated memory if reference count is 0. But in above example we associated the memory from stack to shared_ptr object and in its destructor this shared_ptr object will call delete operation on this memory. As this memory was from stack not from heap, so our program will crash.
Hence, its advised not to create shared_ptr from raw pointers directly. Instead of that we should use make_shared<> like,
Click Here to Subscribe for more Articles / Tutorials like this.
// As ptr_2 dont know that the same raw pointer is used by another shared_ptr i.e. ptr_1, therefore
// here when ptr_2 goes out of scope and it deletes the raw pointer associated with it.
// Now ptr_1 is internally containing a dangling pointer. Therefore when we it
// will go out of scope it will again try to delete the already deleted raw pointer and application
// will crash.
Smart tips to help you format and write a cover letter
Struggling to write a cover letter that will catch an employer's attention? We've got tips to help you show your best self—and a sample you can use to get started.
There's nothing scary about writing a cover letter.
You've found the perfect job, hit the "apply" button, and started the process with your engines revved and ready. But wait! Slam the brakes! They want a cover letter. Oh no.
Don't let this request derail you. Here's everything you need to know to write a letter that truly sells your skills. Plus, scroll down to see a sample cover letter you can use to craft your own.
What is a cover letter?
A cover letter is a one-page document that, along with your resume, is sent with your job application. A cover letter is your chance to tell a potential employer why you’re the perfect person for the position and how your skills and expertise can add value to the company. The letter should be professional but personable, and serve as a sort of introduction.
Do I need to send a cover letter?
A lot of job seekers today wonder if a cover letter is still appropriate to send with your resume—and the answer is yes! Even if an employer doesn’t ask for a cover letter, it couldn’t hurt to send one. In fact, it’s can help you get someone's attention in a different way, and it can be a great way to display your enthusiasm for the job and company.
What are the basic elements of a cover letter?
- Greeting: Address your cover letter to the proper person.
- Opening: Write a personable, inviting opening paragraph that notes how your skills are a perfect fit to the job and displays your enthusiasm.
- Hook: Highlight your past achievements as they relate to the job you're applying for.
- Skills: Emphasize additional relevant skills, such as computer languages or certifications.
- Close: Briefly recap your strengths as a candidate, and include your contact information.
Cover letter tips
1. Parrot the keywords: Just like with your resume, your cover letters should be customized for each job you apply to. Start by reviewing the job description. In it, you will find important keywords that let you know what kind of employee the company is hoping to find. Use these same keywords throughout your cover letter.
2. Adapt for the company: Each version of your cover letter should talk about how your skills will benefit the particular company that you want to work for. You want to target the company’s needs—not your own. Demonstrate how you could help them achieve their goals. Remember: You're selling yourself in a resume and a cover letter, but the employer has to want to buy.
3. Show you "get" them: Your cover letter should demonstrate that you have done some research into what the organization's pain points are. Presenting yourself as a solution to a hiring manager’s problem can help your cover letter take the right tone. If you’re applying to an administrative position, be sure to mention your time-management skills; if you’re an IT professional, include your expertise in improving efficiency. Always ask yourself: How can I help this company?
4. Proofread. Don’t assume spell check will catch every mistake (it won’t). Slowly review your cover letter to make sure everything reads properly. Have someone else read your cover letter for backup.
Need even more confidence before you start your cover letter? Below are some additional cover letter tips you could reference—or keep scrolling for a cover letter sample:
Cover letter mistakes you should avoid: From overusing “I” to being too vague, there are a bunch of pitfalls that can trip you up. Don’t let them!
Cover letter format and advice tips: Learn how to set up your cover letter and what each section should include.
Cover letter tips for new grads: You might lack real-world work experience, but your cover letter can be chock-full of activities that demonstrate your potential to succeed.
Cover letter tips for technology professionals: The ease of applying to online jobs has led many IT professionals to skip sending a cover letter, but that’s a mistake.
Cover letter tips for finance professionals: If you’re searching for a finance job or want to be prepared just in case, you will need a dynamic cover letter to grab the hiring managers’ attention.
Tips for better email cover letters: If you're emailing a resume, your cover letter will deliver the first impression. These eight tips will help you craft a better email cover letter.
Cover letter sample
Check out the sample cover letter below (or download the template as a Word doc) to get some inspiration to craft your own. And we've also got you covered if you're looking for a cover letter in a specific industry.
Once you've finished your cover letter, consider joining Monster—you can upload and store up to five cover letters and resumes, so that you can apply for jobs on our site in a snap!
Ms. Rhonda West
Customer Service Manager
123 Corporate Blvd.
Sometown, CO 50802
Re: Customer Service Representative Opening (Ref. ID: CS300-Denver)
Dear Ms. West:
I was excited to see your opening for a customer service rep, and I hope to be invited for an interview.
My background includes serving as a customer service associate within both call-center and retail environments. Most recently, I worked on the customer service desk for Discount-Mart, where my responsibilities included handling customer merchandise returns, issuing refunds/store credits, flagging damaged merchandise for shipment back to vendors and providing back-up cashiering during busy periods.
Previously, I worked within two high-volume customer-support call centers for a major telecommunications carrier and a satellite television services provider. In these positions, I demonstrated the ability to resolve a variety of issues and complaints (such as billing disputes, service interruptions or cutoffs, repair technician delays/no-shows and equipment malfunctions). I consistently met my call-volume goals, handling an average of 56 to 60 calls per day.
In addition to this experience, I gained considerable customer service skills during my part-time employment as a waitress and restaurant hostess while in high school.
I also bring to the table strong computer proficiencies in MS Word, MS Excel and CRM database applications and a year of college (business major). Please see the accompanying resume for details of my experience and education.
I am confident that I can offer you the customer service, communication and problem-solving skills you are seeking. Feel free to call me at 555-555-5555 (home) or 555-555-5500 (cell) to arrange an interview. Thank you for your time—I look forward to learning more about this opportunity!