Windows 7 is backward compatible :)
Type: Posts; User: valthyx
Windows 7 is backward compatible :)
Probably your sizeof(int) is 2 bytes. What is your platform?
Beej's guide is not only for beginners. It is for beginners and intermediate network programmers.
Windows socket and linux sockets are similar if you are using BSD sockets. A little bit of extra...
It's a standard set by ANSI C. Anything not 0 is true. This world is full of standards and conventions which sometimes make sense, sometimes don't.
From what i understood from the above post, this will return the size of one of the element in the struct, which is not the whole struct.
Is there any way to know the real size of a struct?
char get_item(int choice)
{
char item[30];
switch (choice)
{
case 1: strcpy(item, " Pioneer MP3 Player");
break;
case 2: strcpy(item, " MOMO Sports...
A very good guide Beej's Guide to Network Programming
if you want to include .c file in main(), use this
# include "mod1.c"
# include "mod2.c"
Make sure all three files are in the same directory. Else, you will have to specify the full path for...
void PrintVals(void (*)(int&, int&),int&, int&);
void foo(int& x, int& y) {
x++;
y++;
}
.
.
.
PrintVals(foo(2,3), 4, 5); //or PrintVals(*foo(2,3), 4, 5);
Thanks for all the help and "cheers". :) I am working on asymmetric encryption.
That is one way. However, programmers normally use the "struct" defined in the header files for extracting the data. You could first strip the ethernet header, then ip header, then transport layer. I...
Thank you. I am kinda forget mathematics from school. Used to calculators.
The socket library will automatically do this for you. You do no have to strip. But from what you are saying, it seems that you are using raw sockets. Check this out...
Could anyone please give me an example, just a simple, for me to get an idea of. Thank you.
It is quite difficult to multiply. For example, I have "1234" and "9694". I would start with
1. 4*4 = 8 (this is fine)
2. 9*3 = 27 (i have to bring the 2 to the next multiplication)
3. 3*6+2 =...
setsockopt(), getsockopt()
This could solve. See the "SO_REUSEADDR" option.
What about this, will it work?
struct newint
{
char m[2000];
};
struct newint myNewint1, myNewint2;
myNewint1.m = "12345";
What about this, will it work?
struct newint
{
char m[2000];
};
struct newint myNewint1, myNewint2;
myNewint1.m = "12345";
Is it possible to store the number as strings and compute them bytes by bytes?
Or, create a newly defined typed which stores a very large int. let's say 1024 buts instead or 32 bits. Is this...
I have a very long number, lets say
An int or a long unsigned int would definitely not be able to store this number. I would like to do some mathematical computation using large numbers,...
I have a program which receives an input from the user. Should I use an array or a pointer for storing the string.
int main()
{
char *prt; //this
//ptr[100]; //or this?
printf("Please enter...
So, what most people would use when creating a GUI applications (Windows and Linux) ?
Thanks alot Mike, I didn't know it is so simple. Does this work for converting "char*" to "system string"? And is there any similar way of converting "system string" to "char*" string?
By the way,...
Thank you.
I have run the code and i get this error.
I am running on windows 7 with admin privileged. I also tried to run the ".exe" with "run as Administrator" but still getting the same...