oh man...
i am too dumb.. the traditional mistake.. ";"
anyway.. thanks for your help.. i appreciate that.. :)
User Profile
Collapse
-
My linking problem is resolved.. thanks to you.. but now i am having another problem..
why my code is not creating the socket... the descriptor is always -1..!!
Here is the code.
...Code:#include "stdafx.h" #include <iostream> #include <conio.h> #include <winsock2.h> using namespace std; int main() { int descriptor; if ((descriptor = socket(PF_INET,Last edited by Rabbit; Feb 16 '14, 10:46 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data. Second warning.Leave a comment:
-
i went to
project->project options->parameters->add library
and then browse
C:\Program Files (x86)\Microsoft SDKs\Windows\v7 .1A\Lib
and added Ws2_32.lib... but still getting the error :(Leave a comment:
-
-
Socket Programming
I have just started to work in socket programming.. I am getting these errors:
"undefined reference to `__imp_socket'"
"ld returned 1 exit status"
my compiler is dev c++ 5.6.1
here is my code
...Code:#include <iostream> #include <conio.h> #include <winsock2.h> using namespace std; int main() { int descriptor; if ((descriptorLast edited by Rabbit; Feb 16 '14, 04:38 AM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data. -
<div> vs <table>
I am working in html and find <div>very helpful..
My question is, should I stop using table anymore to structure html contents or for any purpose as everything that can be done with table can be done more efficiently with div? -
I couldn't understand this (not getting the technical terms like command line program.!):
they run a command line program in a debug from there IDE. When run this way when the program exits the Window closes so they put in the getch so the program doesn't exit. If run not in debug mode or directly from Windows or from a command prompt, as a command line program is intended to be run, then the results remain on screen.Leave a comment:
-
Why write return 0 at the end?
In the above code, why is it necessary to write getch() and return 0? What is their purpose?Code:#include <iostream.h> #include <conio.h> int main () { cout << "Hello World"; getch(); return 0; } -
-
What do you mean by explicitly calling delete and no, it did not crash!Leave a comment:
-
What is the actual concept of delete operator?
Hello all. I am c++ beginner. I am not getting the real concept of delete operator. If it deallocates the memory, then why i am getting such output..!!
Output:Code:int main() { int *a , b=5; a = & b; cout << *a << endl; delete a; cout << *a; getch(); return 0; }
5
5Last edited by zmbd; Dec 31 '12, 02:43 PM. Reason: [Z{Please use the <CODE/> button to format posted code/html/sql}]
No activity results to display
Show More
Leave a comment: