Good Afternoon,
I'm building an email launcher using Visual C++ forms.
Now i don't know much of c++ so that is why i'm using C standard libraries.
I've a text file with a html coded email inside.
If i create a string with predefinied size say
char mail[150000];
fread works fine
however if i allocate the memory fread only reads a few characters(around 265)
char *mail;
mail=(char*)malloc(sizeof(char)*150000);
fread(mail,1,150000,f);
I've tryed opening the file both normal or binary
Need help,
Content of the file
Addional Details.
fread return value matches the characters on the file.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Mail de Ofertas
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 12" />
<meta name="Originator" content="Microsoft Word 12" />
<meta name="Peticion" content="origen=SCQ_SVQ_VGO_XXX&marca=SLP&fdesde=20111202&fhasta=20111203&manual=1&id=PT" />
</head>
<body>
<table width="640" border="0"><tr><td>
<table width="640" border="0">
<tr><td colspan="3"><a target='_blank' href='http://b2b.iberojet.es/entradaMail.aspx?ver=3&marca=SLP&prog=599'><img alt='' src='http://b2b.iberojet.es//contenidos/xml_teletipos/bannermail/slp_0_599.jpg' width='640' height='175' style='border:none;' /></a></td></tr>
<tr><td height="10"></td></tr>
<tr>
<td align="left"><a target='_blank' href='http://b2b.iberojet.es/entradaMail.aspx?ver=3&marca=SLP&prog=707'><img alt='' src='http://b2b.iberojet.es//contenidos/xml_teletipos/bannermail/slp_1_707.jpg' width='200' height='175' style='border:none;' /></a></td>
<td align="center"><a target='_blank' href='http://b2b.iberojet.es/entradaMail.aspx?ver=3&marca=SLP&prog=1601'><img alt='' src='http://b2b.iberojet.es//contenidos/xml_teletipos/bannermail/slp_2_1601.jpg' width='200' height='175' style='border:none;' /></a></td>
<td align="right"><a target='_blank' href='http://www.solplan.es/'><img alt='' src='http://b2b.iberojet.es//contenidos/xml_teletipos/bannermail/slp_3_666.jpg' width='200' height='175' style='border:none;' /></a></td>
</tr>
</table>
<table width="640" border="0">
<tr>
<td height='30' valign='bottom'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; color: #003399;'>02 Baleares y Canarias-> Lanzarote
</span></td>
</tr>
<tr>
<td style='border:1px solid gray;'>
<TABLE border='0' cellPadding='3' width='635' align='center'>
<tr>
<td width="80" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Destino
</span></td>
<td width="60" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Origen
</span></td>
<td width="68" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Validez
</span></td>
<td width="50" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Desde(€)
</span></td>
<td width="190" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Descripción
</span></td>
<td width="35" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Etiquetas
</span></td>
<td width="10" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>pdf
</span></td>
<td width="50" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Reservar
</span></td>
</tr>
<tr>
<td width="80" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>Lanzarote
</span></td>
<td width="60" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>Santiago
</span></td>
<td width="68" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>09/01 - 30/01
</span></td>
<td width="50" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>320,00
</span></td>
<td width="190" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><a style='color: #003399; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;text-decoration: none;' target="blank" href='http://b2b.iberojet.es/contenidos/gesofertas/SLP/jpg/SCQACE0100GGFCHSCQ01.jpg' ><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>Lanzarote, Súper Ganga Oferta Charter
</span></a></td>
<td width="35" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;'>
</td>
<td width="10" style='background:#F9F9F9; border-bottom: 1px solid #999999; border-bottom-style:dotted ;' align="center" valign="top"><a style='color: #003399; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;text-decoration: none;' target="blank" href='http://b2b.iberojet.es/contenidos/gesofertas/SLP/jpg/SCQACE0100GGFCHSCQ01.pdf'><img style="vertical-align:middle;" border="0" title="Imprimir Oferta" src="http://b2b.iberojet.es/teletipos/buscateletipo/img/ico_pdf.gif" /></a></td>
<td width="50" style='background:#F9F9F9; border-bottom: 1px solid #999999; border-bottom-style:dotted ;' align="center" valign="top"><a style='color: #003399; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;text-decoration: none;' target="_blank" href='http://b2b.iberojet.es/entradaMail.aspx?ver=0&marca=SLP&mailteletipo=SCQACE0100GGFCHSCQ01&imprimir=si&telorigen=orig' style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Reservar
</a></td>
</tr>
<tr>
<td width="80" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>Lanzarote
</span></td>
<td width="60" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>Sevilla
</span></td>
<td width="68" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>07/01 - 28/01
</span></td>
<td width="50" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>290,00
</span></td>
<td width="190" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><a style='color: #003399; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;text-decoration: none;' target="blank" href='http://b2b.iberojet.es/contenidos/gesofertas/SLP/jpg/SVQACE0100GGFCHSVQ01.jpg' ><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>Lanzarote, Súper Ganga Oferta Charter
</span></a></td>
<td width="35" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;'>
</td>
<td width="10" style='background:#F9F9F9; border-bottom: 1px solid #999999; border-bottom-style:dotted ;' align="center" valign="top"><a style='color: #003399; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;text-decoration: none;' target="blank" href='http://b2b.iberojet.es/contenidos/gesofertas/SLP/jpg/SVQACE0100GGFCHSVQ01.pdf'><img style="vertical-align:middle;" border="0" title="Imprimir Oferta" src="http://b2b.iberojet.es/teletipos/buscateletipo/img/ico_pdf.gif" /></a></td>
<td width="50" style='background:#F9F9F9; border-bottom: 1px solid #999999; border-bottom-style:dotted ;' align="center" valign="top"><a style='color: #003399; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;text-decoration: none;' target="_blank" href='http://b2b.iberojet.es/entradaMail.aspx?ver=0&marca=SLP&mailteletipo=SVQACE0100GGFCHSVQ01&imprimir=si&telorigen=orig' style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Reservar
</a></td>
</tr>
</table></td></tr>
<tr>
<td height='30' valign='bottom'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; color: #003399;'>02 Baleares y Canarias-> Tenerife
</span></td>
</tr>
<tr>
<td style='border:1px solid gray;'>
<TABLE border='0' cellPadding='3' width='635' align='center'>
<tr>
<td width="80" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Destino
</span></td>
<td width="60" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Origen
</span></td>
<td width="68" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Validez
</span></td>
<td width="50" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Desde(€)
</span></td>
<td width="190" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Descripción
</span></td>
<td width="35" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Etiquetas
</span></td>
<td width="10" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>pdf
</span></td>
<td width="50" align="center" style='border-collapse: collapse; border-bottom: 1px solid #999999;'><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Reservar
</span></td>
</tr>
<tr>
<td width="80" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>Tenerife
</span></td>
<td width="60" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>Vigo
</span></td>
<td width="68" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>09/01 - 30/01
</span></td>
<td width="50" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>300,00
</span></td>
<td width="190" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><a style='color: #003399; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;text-decoration: none;' target="blank" href='http://b2b.iberojet.es/contenidos/gesofertas/SLP/jpg/VGOTCI0100GGFCHVGO01.jpg' ><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>Tenerife, Súper Ganga Oferta Charter
</span></a></td>
<td width="35" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;'>
</td>
<td width="10" style='background:#F9F9F9; border-bottom: 1px solid #999999; border-bottom-style:dotted ;' align="center" valign="top"><a style='color: #003399; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;text-decoration: none;' target="blank" href='http://b2b.iberojet.es/contenidos/gesofertas/SLP/jpg/VGOTCI0100GGFCHVGO01.pdf'><img style="vertical-align:middle;" border="0" title="Imprimir Oferta" src="http://b2b.iberojet.es/teletipos/buscateletipo/img/ico_pdf.gif" /></a></td>
<td width="50" style='background:#F9F9F9; border-bottom: 1px solid #999999; border-bottom-style:dotted ;' align="center" valign="top"><a style='color: #003399; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;text-decoration: none;' target="_blank" href='http://b2b.iberojet.es/entradaMail.aspx?ver=0&marca=SLP&mailteletipo=VGOTCI0100GGFCHVGO01&imprimir=si&telorigen=orig' style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Reservar
</a></td>
</tr>
<tr>
<td width="80" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>Tenerife
</span></td>
<td width="60" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>Santiago
</span></td>
<td width="68" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>03/01 - 31/01
</span></td>
<td width="50" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>300,00
</span></td>
<td width="190" align="left" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;' valign="top"><a style='color: #003399; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;text-decoration: none;' target="blank" href='http://b2b.iberojet.es/contenidos/gesofertas/SLP/jpg/SCQTCI0100GGFCHSCQ01.jpg' ><span style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; color: #666666;'>Tenerife, Súper Ganga Oferta Charter
</span></a></td>
<td width="35" style='background:#EDF1F8; border-bottom: 1px solid #999999; border-bottom-style:dotted;'>
</td>
<td width="10" style='background:#F9F9F9; border-bottom: 1px solid #999999; border-bottom-style:dotted ;' align="center" valign="top"><a style='color: #003399; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;text-decoration: none;' target="blank" href='http://b2b.iberojet.es/contenidos/gesofertas/SLP/jpg/SCQTCI0100GGFCHSCQ01.pdf'><img style="vertical-align:middle;" border="0" title="Imprimir Oferta" src="http://b2b.iberojet.es/teletipos/buscateletipo/img/ico_pdf.gif" /></a></td>
<td width="50" style='background:#F9F9F9; border-bottom: 1px solid #999999; border-bottom-style:dotted ;' align="center" valign="top"><a style='color: #003399; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;text-decoration: none;' target="_blank" href='http://b2b.iberojet.es/entradaMail.aspx?ver=0&marca=SLP&mailteletipo=SCQTCI0100GGFCHSCQ01&imprimir=si&telorigen=orig' style='font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #003399;'>Reservar
</a></td>
</tr>
</table></td></tr>
</table>
<table width="640" border="0">
<tr><td height="5"></td></tr>
<tr><td colspan="3"><a target='_blank' href='http://b2b.iberojet.es/entradaMail.aspx?ver=3&marca=SLP&prog=691'><img alt='' src='http://b2b.iberojet.es//contenidos/xml_teletipos/bannermail/slp_4_691.jpg' width='640' height='175' style='border:none;' /></a></td></tr>
</table>
</td></tr></table>
</body>
</html>