technology -5 Light Poster

Here are some of the Books I have collected and I recommend:

C++ Primer Plus The Waite Group SAMS
This is good for intermedia coders to the C++ language.
Using C++ McGregor QUE
This is good for just past beginners.
Deitel and Deitel C++;
The above is excellent for beginners.
C++ Builder Unleashed by Charly Calvert.
This is good for those with C++ Skills and want automatically want to be able to generate
forms in C++ instead of faffinf around with MFC etc.
Add those to all the PDF for C++ Ive read for over 10 years and the best of which was Herbert Schildt and O Reilly Books on C are not so great.
The Idiots Guide to C++ is a very good introduction to working with pizzas and object orientated programming.

technology -5 Light Poster

LOL Im no BILL GATE THE II OR III just was a beginnering in basic v2 in 1982 when Commodore 64 came out used it mainly for playing games and writing a bit of asm.

Are you jealous that Im congratilating Bjarne Stroustroup on writing C++ Ive seen a few wrappers for C that tried to make it into an object orientated language before C++.

I learned Objects in C++ and VB but Im no Bill Gates he used to write stuff on Minicomputers and mainframes. All I had was my venerable Commodore 64

technology -5 Light Poster

Just thought Id start a thread for firewall software as that is such important to people using the web.

Im currently using commodo and its version 3 before that I was using PC TOOLS then before that Zone Alarm.

I upgraded to more full featured firewall programs with more security and features as time went on.

The above were all free software:

Here is the Link to Commodo software firewall:

http://personalfirewall.comodo.com/

Please submit any links to firewall software that you think is going to be useful but it must be free no commercial advertising.

technology -5 Light Poster

That is not wisdom my friend. It is a matter of show-effort-and-we-help!
If he shows enough effort you can help him like that but not give him copy and paste and bang, here is 100%. Some people use week(s) trying to resolve same problem showing a lot of efforts, reading a lot. I think it is fair for big hand to be given to those but not lazy gimme boys.

I would rather get MY 0% than get 100% which is NOT MINE.
I think that should be the motive, but then that is my opinion ;)

I thought I had to give 100% solution to any problem that came along but now Im warned becos he was looking for easy solution to his college work I came along and like a mug have given him the work he was looking for. But not anymore full solutions unless its required. I will give hints and guides but not full final code for solutions.

Aranarth commented: That's the spirit. +1
technology -5 Light Poster

Hey Ive just joined as a newbie and manage to get 4 negative down voters this could ruin my life plan ROFL LOL.

Anyway just wait till I get better in C++;

Hiya all the negative downvoters booo booo treating a newbie like this!

technology -5 Light Poster

Software worth downloading:

Mercury SMTP Server, hey its free and works together with freepops to give a slution to handling many pop3 user account mail being fed into a single account on Mercury.


http://www.freepops.org/en/

the above link for freepops

and for mercury smtp email try:

http://www.snapfiles.com/get/mercury.html

technology -5 Light Poster

Hello all,
I am James Im from London and lived in Ireland, I used to program anything that came along mostly worked on help desk fixing ms access and visual basic some sql and installing netware fixes and updates. Also fixed hard and bios problems with PC's this was about 10 years ago. Now I can contribute small amounts of c/c++ help but Im no expert at c++ but Im goona learn from the resident experts on site and study more c++.

I thought this was a page for newbies to post their hello all page. Maybe Im mistaken if not.

Anyway hello nick and all others who have posted in here.

I got a beats from the resident experts for posting a solution for a college kid that anyway one should be able to code and on top of that it had errors in the code ROFL LOL what am I the resident error prone person I say.

Well guys I didnt know we are not supposed to post the solutions to college questions for projects. Now Im in the know.

technology -5 Light Poster

Line 2 (iostream), line 4 (char**), rest is missing std:: name qualifiers.

Thanks for the help where there where errors;

technology -5 Light Poster

Im not the original poster of the question just a newbie posting here to help people so thats all.
I wont be posting complete solutions ever again

technology -5 Light Poster

My huge appreciation for this as this has been annoying the hell out of me for a while. Anyhow If I was with you I buy ya a beer for that thanks all.

technology -5 Light Poster
//'here is the code to calculate an area of a square or rectangle in C
//'to convert to c++ just read how to use cin and cout and the right include file.
#include <stdio.h>
#include <conio.h>

long width;
long length;


int main(int argc, char *argv)
{
       clrscr();

     printf("Enter Width:");
     scanf("%ld",&width);
     printf("Enter Length:");
     scanf("%ld",&length);

     //** Formula Length Times Width = area of the object
     printf("Area of object:%ld\n",width * length);

     printf("Press any key to continue..");
     char c;
     c = getch();

}
Nick Evan commented: Not C++, spponfeeding and horrible code -3
technology -5 Light Poster

Since the code posted contains a total of ten mistakes and is also meant for a rectangle, the OP will still need to show some initiative of his own.

what are the ten mistakes pobably posting the code was the ten mistakes, emember im a newbie

technology -5 Light Poster

point out the ten mistakes for me to ponder why i exist even

technology -5 Light Poster

Ok Guys I need some help with a small nigglying problem I have traditionally used
the following code to check for a keypress when using the console and in msdos thats how far back Ive been using getch() but need to do something similar to this in C++ with cin and iostream.h

see:

#include <conio.h>
char c;
printf("Press any key to continue..");
c = getch();

Is there some easy way to do the same in C++ with iostream.h and cin ?

any help would be greatly appreciated.

technology -5 Light Poster

Here is the same code similar to the C code in C++ to save you the bother. Thread Solved.

#include <iostream.h>

int main (int argc, char * argv)
{
   long width;
   long length;
   char c;

   cout << "Enter Width:";
   cin >> width;
   cout << "Enter Length:";
   cin >> length;

   cout << "Area:" << length * width;
   cout << "\n" ;
   cout << "Press any key to continue..";
   cin >> c;
}
Ketsuekiame commented: Bad Form =/ +0
technology -5 Light Poster
//'here is the code to calculate an area of a square or rectangle in C
//'to convert to c++ just read how to use cin and cout and the right include file.
#include <stdio.h>
#include <conio.h>

long width;
long length;


int main(int argc, char *argv)
{
       clrscr();
 
     printf("Enter Width:");
     scanf("%ld",width);
     printf("Enter Length:");
     scanf("%ld",length);

     //** Formula Length Times Width = area of the object
     printf("Area of object:%ld\n",width * length);
     
     printf("Press any key to continue..");
     char c;
     c = getch();

}
technology -5 Light Poster
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

//*************************************************
//skips even numbers and only checks squared values
//reduces the loop size runtime
//*************************************************

int IsPrime(long number);

int main(int argc, char *argv[]){
	long n;
   printf("Enter number to check for primality:");
   scanf("%ld",&n);
	if(IsPrime(n)) {
   	printf("Number is a prime\n");
   } else {
      printf("Number is not a prime\n");
   }

   int c;
   printf("Press any key to continue..");
   c = getch();
}

int IsPrime(long number) {
    long i;

    i =2;

    if (number == 2) {
       return 1;
    }

    if (number % i == 0) return 0;
    for (i=3; (i*i)<=number; i+=2) {
        if (number % i == 0) return 0;
    }
    return 1;
}
technology -5 Light Poster
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

//*************************************************
//skips even numbers and only checks squared values
//reduces the loop size runtime
//*************************************************

int IsPrime(long number);

int main(int argc, char *argv[]){
	long n;
   printf("Enter number to check for primality:");
   scanf("%ld",&n);
	if(IsPrime(n)) {
   	printf("Number is a prime\n");
   } else {
      printf("Number is not a prime\n");
   }

   int c;
   printf("Press any key to continue..");
   c = getch();
}

int IsPrime(long number) {
    long i;



    i =2;
    if (number % i == 0) return 0;
    
    for (i=3; (i*i)<=number; i+=2) {
        if (number % i == 0) return 0;
    }
    return 1;
}
technology -5 Light Poster

I would just like to say to Bjarne Stroustroup well done on C++ I started with C Programming in 1982 for windows later and went onto C++ a decade later around 1994 I went through the process of relearning how to do it all over again in C++ using objects and thanks to his language objects are upgradeable resusable to some degree but can hide their complexity and expose simple methods for manipulating the objects. Trying to implement an object orietated approach for large projects in C would be a headache as I tried out a method for encapsulating C in a manner with a wrapper to give C an Objected Orietated extension but the translator produced C Code but the wrapper was a nightmare to use so thanks Bjarne for C++ and I hope you will work on all you ever wanted to know about C++ book something simple like the K&R AT&T C Book for C++ but in a small book nothing too massive for beginners to C++.

technology -5 Light Poster

now checks number 2, the code works by only showing a failure if the division by number 2 works or on an even number this is how the code manages to check for non prime numbers, if the check for number 2 is taken out then all results return true for prime numbers.

The check for positive odd prime numbers only checks 3 5 7 9 11 ... upto n

so Ive check this and the code works so solved.

Sorry for earlier code without the check for value 2 for non primes.

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

//*************************************************
//skips even numbers and only checks squared values
//reduces the loop size runtime
//*************************************************

int IsPrime(long number);

int main(int argc, char *argv[]){
	long n;
   printf("Enter number to check for primality:");
   scanf("%ld",&n);
	if(IsPrime(n)) {
   	printf("Number is a prime\n");
   } else {
      printf("Number is not a prime\n");
   }

   int c;
   printf("Press any key to continue..");
   c = getch();
}

int IsPrime(long number) {
    long i;



    i =2;
    if (number % i == 0) return 0;
    
    for (i=3; (i*i)<=number; i+=2) {
        if (number % i == 0) return 0;
    }
    return 1;
}
technology -5 Light Poster

forgot needed to check munber 2 Solution provided is solution to question. So Flag as solved.

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

//*************************************************
//skips even numbers and only checks squared values
//reduces the loop size runtime
//*************************************************

int IsPrime(long number);

int main(int argc, char *argv[]){
	long n;
   printf("Enter number to check for primality:");
   scanf("%ld",&n);
	if(IsPrime(n)) {
   	printf("Number is a prime\n");
   } else {
      printf("Number is not a prime\n");
   }

   int c;
   printf("Press any key to continue..");
   c = getch();
}

int IsPrime(long number) {
    long i;


    for (i=3; (i*i)<=number; i+=2) {
        if (number % i == 0) return 0;
    }
    return 1;
}
technology -5 Light Poster

The above post solves the thread

WaltP commented: We do not SOLVE problems for people on this forum. We HELP them find their own answers. We also don't post 5 messages in a row trying to fix the previous bad posts -- we make sure the first post is correct. -3
technology -5 Light Poster

This is short and sweet and if any problems is easily modifiable,
Not it checks the squared numbers to reduce the loop size and also
the loop starts at 3 and goes up by 2 each increment so skips even numbers.
This speeds the checking for a prime number when check larger numbers.

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

//*************************************************
//skips even numbers and only checks squared values
//reduces the loop size runtime
//*************************************************
#pragma argsused

int IsPrime(long number);

int main(int argc, char *argv[]){
	long n;

   clrscr();
   printf("Enter number to check for primality:");
   scanf("%ld",&n);
	if(IsPrime(n)) {
   	printf("Number is a prime\n");
   } else {
      printf("Number is not a prime\n");
   }

   int c;
   printf("Press any key to continue..");
   c = getch();
}

int IsPrime(long number) {
    long i;
    if(number == 1 || number == 3) {
    	return 1;
    }
    if (number == 2) {
    	return 0;
    }
    for (i=3; (i*i)<=number; i+=2) {
        if (number % i == 0) return 0;
    }
    return 1;
}
technology -5 Light Poster

I came across a solution that worked for checking prime numbers. The idea is to square the input and check if the squared input of the number in question is prime if so then the input is prime and this seems to cut the loop sizes smaller when checking if a number is a prime number.

technology -5 Light Poster

Create a new project and add 2 forms create 1 button named command1 on form1 and then create another button on form2 called command1

The Code to click the button on form1 from form2 is:

Public Sub Command2_Click()
call Form1.Command1_Click
End Sub


'Please change the access modifier of the sub command1_click to public and not private


'like this:

Public Sub Command1_Click()
   MsgBox "Hello", vbOKOnly, "World"
End Sub
technology -5 Light Poster

Ive found a link mentioning IPSEC and Winsock Secure Socket Extensions http://msdn.microsoft.com/en-us/library/bb394815(VS.85).aspx

Nust be too complex for me at the moment can anyone recommeend a good book with examples for windows secure sockets extensions. Any help greatly appreciated.

technology -5 Light Poster

Fellow coders Ive contributed this code to show how to send an email using winsock but Im having problems working out what to do to get this to be SSL oriented and know that it requires something to do with Secure Sockets and SetSockOpt and GetSockOpt and WSAIOctl but Im stumped about setting the code Ive got to work with SECURE SOCKETS. Can anyone out there in DaniWeb Help make this to work with Secure Sockets just getting the Secure Socket Connection working would be fine as all the code for the SMTP is already done below:

Ideally getting this code to work with Secure Sockets will mean it connecting to PORT 465 on SSL SMTP Servers elsewhere which will require a logon and password and Ive no idea how this all fits in with the Secure Sockets Layer. I know im on the right track though.

#include <iostream.h>
#include <winsock2.h>
#include <windows.h>
//#include <string>
#include <stdio.h>
#include <string.h>

//using namespace std;




#define MAX_LENGTH 1024
#pragma argsused

char *fgets(char *line, int maxline, FILE *fp);
int fputs(char *line, FILE *fp);
int getline(char *line, int max);

void main()
{
int s_len, r_len;
int skt_Smtp;
int success;
struct sockaddr_in st_Sockaddr;
char recv_Buf[MAX_LENGTH];
char send_Buf[MAX_LENGTH];

char abuf[MAX_LENGTH] = "";;
char bbuf[MAX_LENGTH] = "";;
//using namespace std;
//string my_string;


char text[1024] = "";



//Initialize Sockets
WSADATA wsa;
WSAStartup(MAKEWORD(2, 0), &wsa);


skt_Smtp = socket(AF_INET,SOCK_STREAM,0);
if (skt_Smtp < 0)
{
cout<< "Error Creating Socket"<<endl;
return;
}
else
{
st_Sockaddr.sin_family = AF_INET;
st_Sockaddr.sin_port = htons(25);

//Get …
technology -5 Light Poster

forgot to embed the code example in the code tags.

#include <iostream.h>
#include <winsock2.h>
#include <windows.h>
//#include <string>
#include <stdio.h>
#include <string.h>

//using namespace std;




#define MAX_LENGTH 1024
#pragma argsused

char *fgets(char *line, int maxline, FILE *fp);
int fputs(char *line, FILE *fp);
int getline(char *line, int max);

void main()
{
int s_len, r_len;
int skt_Smtp;
int success;
struct sockaddr_in st_Sockaddr;
char recv_Buf[MAX_LENGTH];
char send_Buf[MAX_LENGTH];

char abuf[MAX_LENGTH] = "";;
char bbuf[MAX_LENGTH] = "";;
//using namespace std;
//string my_string;


char text[1024] = "";



//Initialize Sockets
WSADATA wsa;
WSAStartup(MAKEWORD(2, 0), &wsa);


skt_Smtp = socket(AF_INET,SOCK_STREAM,0);
if (skt_Smtp < 0)
{
cout<< "Error Creating Socket"<<endl;
return;
}
else
{
st_Sockaddr.sin_family = AF_INET;
st_Sockaddr.sin_port = htons(25);

//Get the IP address and initialize the structure
st_Sockaddr.sin_addr.s_addr = inet_addr("127.0.0.1");

success = connect(skt_Smtp,(struct sockaddr *) &st_Sockaddr,sizeof(st_Sockaddr));

r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);
recv_Buf[r_len] = '\0';

cout<< recv_Buf<<endl;

//Say Hello to the domain
strcpy(send_Buf,"HELO someone@someserver.net\r\n");

s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);

r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);
recv_Buf[r_len] = '\0';

cout<< recv_Buf<<endl;

//Send from address

strcpy(send_Buf , "MAIL FROM: <someone@gmail.com>\r\n");


s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);

r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);
recv_Buf[r_len] = '\0';

//cout<< recv_Buf<<endl;

//Send RCPT address
//strcpy(send_Buf,"RCPT TO: <someone@somewhere.com>\r\n");
cout << "RCPT TO:";
//strcpy(text,"RCPT TO:");
strcat(bbuf,"RCPT TO:<");

getline(text,255);

text[strlen(text)-1] = 0; /* 'P' is not in `p` (and it isn't in `mystr` either) */

strcat(bbuf, text );

//cout << text;

strcat(bbuf,">");


strcpy(send_Buf,bbuf);

s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);

strcpy(send_Buf,"\r\n");

s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);


cout<< send_Buf<<endl;

r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);

recv_Buf[r_len] = '\0';

//cout<< recv_Buf<<endl;

// Send DATA
strcpy(send_Buf,"DATA\r\n");

s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);

r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);
recv_Buf[r_len] = '\0';

//cout<< recv_Buf<<endl;


// Send DATA

//strcpy(send_Buf,"Subject:new subject\r\n\r\n\r\n");
cout …
technology -5 Light Poster

Here is some sample code:

Samples C++ Code to do SMTP From a Win32 Console
#include <iostream.h>
#include <winsock2.h>
#include <windows.h>
//#include <string>
#include <stdio.h>
#include <string.h>

//using namespace std;




#define MAX_LENGTH 1024
#pragma argsused

char *fgets(char *line, int maxline, FILE *fp);
int fputs(char *line, FILE *fp);
int getline(char *line, int max);

void main()
{
int s_len, r_len;
int skt_Smtp;
int success;
struct sockaddr_in st_Sockaddr;
char recv_Buf[MAX_LENGTH];
char send_Buf[MAX_LENGTH];

char abuf[MAX_LENGTH] = "";;
char bbuf[MAX_LENGTH] = "";;
//using namespace std;
//string my_string;


char text[1024] = "";



//Initialize Sockets
WSADATA wsa;
WSAStartup(MAKEWORD(2, 0), &wsa);


skt_Smtp = socket(AF_INET,SOCK_STREAM,0);
if (skt_Smtp < 0)
{
cout<< "Error Creating Socket"<<endl;
return;
}
else
{
st_Sockaddr.sin_family = AF_INET;
st_Sockaddr.sin_port = htons(25);

//Get the IP address and initialize the structure
st_Sockaddr.sin_addr.s_addr = inet_addr("127.0.0.1");

success = connect(skt_Smtp,(struct sockaddr *) &st_Sockaddr,sizeof(st_Sockaddr));

r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);
recv_Buf[r_len] = '\0';

cout<< recv_Buf<<endl;

//Say Hello to the domain
strcpy(send_Buf,"HELO someoneatsomewhere.net\r\n");

s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);

r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);
recv_Buf[r_len] = '\0';

cout<< recv_Buf<<endl;

//Send from address

strcpy(send_Buf , "MAIL FROM: <someone@gmail.com>\r\n");


s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);

r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);
recv_Buf[r_len] = '\0';

//cout<< recv_Buf<<endl;

//Send RCPT address
//strcpy(send_Buf,"RCPT TO: <someone@gmail.com>\r\n");
cout << "RCPT TO:";
//strcpy(text,"RCPT TO:");
strcat(bbuf,"RCPT TO:<");

getline(text,255);

text[strlen(text)-1] = 0; /* 'P' is not in `p` (and it isn't in `mystr` either) */

strcat(bbuf, text );

//cout << text;

strcat(bbuf,">");


strcpy(send_Buf,bbuf);

s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);

strcpy(send_Buf,"\r\n");

s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);


cout<< send_Buf<<endl;

r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);

recv_Buf[r_len] = '\0';

//cout<< recv_Buf<<endl;

// Send DATA
strcpy(send_Buf,"DATA\r\n");

s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);

r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);
recv_Buf[r_len] = '\0';

//cout<< recv_Buf<<endl;


// …
technology -5 Light Poster

IF your looking at parsing a list of single elements you could try something simpler along the following lines cause it uses the split function to deciper an input string based on a separator that you supply the function:

#include<stdio.h>
#include<string.h>
#include<conio.h>
#include<alloc.h>

struct node* split(char splitc,char *astring);

//-------------------------------------------------
struct node
{
  char data[255];
  struct node *next;
};
//------------------------------------------------------------
//------------------------------------------------------------------
//----------------------------------------------------
void main()
{
   char astring[255] = { "hello this is a text message" };
   struct node *current,*start;

   //Decode the astring with the split funtion using space separator
	start = split(' ',astring);

   //display

   printf("\nThe Linked List : \n");
   current=start;
   while(current!=NULL)
   {
   printf("&current->data:%s\n",&current->data);
   current=current->next;

   }
 	printf("\nPress any key to continue...");
 	getch();
}
//----------------------------------------------------

struct node* split(char splitc,char *astring){

	int d=0;
   int i=0;
   int c=0;
   int e=0;
   int f=0;

   char opcstr[255];
   struct node *new_node,*current,*list;
   f=0;
 	for(i=0;i<=strlen(astring);i++)
   {
     if(i<=strlen(astring))
     {
   	if((astring[i] == splitc)||(i==strlen(astring))) {
      opcstr[c] = NULL;
      printf("OPCSTR:%s\n",opcstr);
         new_node=(struct node *)malloc(sizeof(struct node));
         if (f==0) {
         	list = NULL;
         }

         f++;
      	strcpy(&new_node->data[0],opcstr);

   		new_node->next=NULL;

   		if(list==NULL)
   		{
   		list=new_node;
   		current=new_node;
   		}
   		else
   		{
   		current->next=new_node;
   		current=new_node;
   		}
         e=strlen(opcstr);
         for(d=0;d<=e;d++)
         	opcstr[d] = NULL;
         c=0;
      } else {
       	opcstr[c] = astring[i];
      	c++;
      }
     }
   }

   return list;
}
technology -5 Light Poster
#include <iostream.h>
        #include <winsock2.h>
      #include <windows.h>
      //#include <string>
      #include <stdio.h>
      #include <string.h>

      //using namespace std;




      #define MAX_LENGTH 1024
      #pragma argsused

char *fgets(char *line, int maxline, FILE *fp);
int fputs(char *line, FILE *fp);
int getline(char *line, int max);

      void main()
      {
          int s_len, r_len;
          int skt_Smtp;
          int success;
          struct sockaddr_in st_Sockaddr;
          char recv_Buf[MAX_LENGTH];
          char send_Buf[MAX_LENGTH];

          char abuf[MAX_LENGTH] = "";;
          char bbuf[MAX_LENGTH] = "";;
          //using namespace std;
          //string my_string;


          char text[1024] = "";



          //Initialize Sockets
          WSADATA wsa;
          WSAStartup(MAKEWORD(2, 0), &wsa);


          skt_Smtp = socket(AF_INET,SOCK_STREAM,0);
          if (skt_Smtp < 0)
          {
              cout<< "Error Creating Socket"<<endl;
              return;
          }
         else
         {
              st_Sockaddr.sin_family = AF_INET;
              st_Sockaddr.sin_port = htons(25);

             //Get the IP address and initialize the structure
             st_Sockaddr.sin_addr.s_addr = inet_addr("127.0.0.1");

             success = connect(skt_Smtp,(struct sockaddr *) &st_Sockaddr,sizeof(st_Sockaddr));

             r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);
             recv_Buf[r_len] = '\0';

             cout<< recv_Buf<<endl;

             //Say Hello to the domain
             strcpy(send_Buf,"HELO [email]jameshernon123@oxymoron.homeip.net[/email]\r\n");

             s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);

             r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);
             recv_Buf[r_len] = '\0';

             cout<< recv_Buf<<endl;

             //Send from address

             strcpy(send_Buf ,  "MAIL FROM: <jahernon@gmail.com>\r\n");


             s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);

             r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);
             recv_Buf[r_len] = '\0';

             //cout<< recv_Buf<<endl;

             //Send RCPT address
             //strcpy(send_Buf,"RCPT TO: <jameshernon231@btinternet.com>\r\n");
             cout << "RCPT TO:";
             //strcpy(text,"RCPT TO:");
             strcat(bbuf,"RCPT TO:<");

             getline(text,255);

             text[strlen(text)-1] = 0; /* 'P' is not in `p` (and it isn't in `mystr` either) */

             strcat(bbuf, text );

             //cout << text;

             strcat(bbuf,">");


             strcpy(send_Buf,bbuf);

             s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);

             strcpy(send_Buf,"\r\n");

             s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);


             cout<< send_Buf<<endl;

             r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);

             recv_Buf[r_len] = '\0';

             //cout<< recv_Buf<<endl;

             // Send DATA
             strcpy(send_Buf,"DATA\r\n");

             s_len = send(skt_Smtp,send_Buf,strlen(send_Buf),0);

             r_len = recv(skt_Smtp,recv_Buf,MAX_LENGTH,0);
             recv_Buf[r_len] = '\0';

             //cout<< recv_Buf<<endl;


             // Send DATA

            //strcpy(send_Buf,"Subject:new subject\r\n\r\n\r\n");
            cout << "Enter Subject:";
            strcpy(text,"Subject:");
            getline(&text[8],255);
            int t;
            //t=sizeof(text);
            t = …
technology -5 Light Poster
// helloworld.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>

CONSOLE_SCREEN_BUFFER_INFO csbi;

void gotoxy ( short x, short y )
{  COORD coord = {x, y};
   SetConsoleCursorPosition ( GetStdHandle ( STD_OUTPUT_HANDLE ), coord );
}

COORD getxy (  CONSOLE_SCREEN_BUFFER_INFO * csbi)
{
	
	COORD coord = csbi->dwCursorPosition;
	return coord;
}

char getCursorChar(){    
	
	char c = '\0';

    CONSOLE_SCREEN_BUFFER_INFO con;
    HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);
    if (hcon != INVALID_HANDLE_VALUE && 
		GetConsoleScreenBufferInfo(hcon,&con)) {
			DWORD read = 0;
			if (!ReadConsoleOutputCharacterA(hcon,&c,1,
				con.dwCursorPosition,&read) || read != 1 
				)  
				c = '\0';
    }    
	return c;
}

int main(int argc, char* argv[])
{	
	char ch;
	COORD coord;
		
	gotoxy( 10,5);
	printf("Hello World!\n");

	//Read the Cursor Position from CONSOLE_SCREEN_BUFFER_INFO
	GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
	coord = getxy( &csbi);

	gotoxy(10,6);
	printf ("X:%d", coord.X);
	printf (" Y:%d",coord.Y);


	gotoxy(16,5);
	ch = getCursorChar();
	gotoxy(0,7);
	printf("Cursor Char:%c\n",ch);
	return 0;
}