importing to project ( noob help )
hello , I'm not too experienced with c++ yet and especially not projects. I've found out that when you have two source codes and you want to merge them together you need some kind of code binding then.
Q1 : what is this code and can you tell me a bit more about whats so handy about different source codes.
Q2 : can I upload an image to my program that way , and if not how can I.
Q3 : how do I display it and can it be a .JPG instead of a Bitmap becuase I've only seen bMP's so far.
for example :
I wrote a little chat program ( without server yet ) and I want it to display a picture before the users name evry time the user says something , what do I have to add to this code then or do I need other graphics etc. ?
Code:
#include <iostream>
using namespace std ;
#include <string>
#include <windows.h>
int main ( int , char** )
{
unsigned char x = 4 ;
char pname[64] ;
unsigned char z = 0 ; // don't use some of these yet
unsigned char a = 2;
char says[64] ;
// --------------------colour-----------------------//
//( removed this for the Xample to make it more easy to handle )//
//-------------ask for username-------------------//
Sleep ( x ) ;
cout << endl << "username: " ;
if ( pname != 0 ) {
gets(pname);
//-------------------chat-----------------------//
string message;
while ( true ) {
cout << endl ;
getline(cin,message);
if( !message.length() ) break;
cout << pname << " says : " << message << endl;
}
//-----------when out of chat loop------------//
cin.ignore();
return 0 ;
}
}
sorry for this newbish post , but I really wanna learn.
thanks :D