How to add link inside a query_posts function

Hi guys, iam very new at developing wordpress theme, i learned alot reading the book HOW TO BUILD A WICKED WORDPRESS THEME, so i just started my first magazine theme, and since i dont really know PHP, i having a problem to add a link inside a function, so far i have this function:

function takecat3() {
	query_posts( array ( 'posts_per_page' =>3, 'cat' => 3 ));
	while ( have_posts() ) : the_post();
	echo '<div class="cabelobox">';
	the_post_thumbnail( 'foto-inicial' );
        the_title();
	echo '</div>';
	endwhile;
	wp_reset_query();
}
	

It grabs the Featured Image, and the TITLE of the 3 last posts on category with the ID = 3, and its working, but i want to add a link into the image and title of the post, but i really dont know how to do that, i familiarized with the_permalink(), but i dont know how to put it in a way that it works, with anybody knows how to do that, i would appreciate alot, thanks!

This is the third place, i post that same question, but after think for a while a managed to solve my own problem, this was the solution that i found:


query_posts( array ( 'posts_per_page' =>3, 'cat' => 3 ));
	while ( have_posts() ) : the_post();
	echo '<div class="cabelobox">';
	echo '<a href="';
	the_permalink();
	echo '">';
	the_post_thumbnail( 'foto-inicial' );
    the_title();
	echo '</a>';
	echo '</div>';
	endwhile;
	wp_reset_query();

So, thanks anyway!