Hi!
I have two strings:
char str_1[] = "First String ";
char str_2[] = "Second String";
how do I copy the second string at the end of first string, so the result would be:
"First String Second...
Type: Posts; User: hyaku_
Hi!
I have two strings:
char str_1[] = "First String ";
char str_2[] = "Second String";
how do I copy the second string at the end of first string, so the result would be:
"First String Second...
my_arr[last_element] = null; ?
I'll try that out right now!
Hi!
I have a two string arrays, that I sent over the network, but the problem is that when I define them, GCC adds null at the end. I know it sopose to be like that, because it's string termination...
Thank you both, that worked!:
#include <stdlib.h>
#include <stdio.h>
int main() {
FILE *fd;
fd = fopen("file", "r");
Thanks!
The problem is that I don't know the length of the second variable, so I won't be able to tell fscanf(); the length. Is it posible to just skip the second variable? for example:
...
Hi!
I wrote a small code, that reads contents of the file and puts it into multidimensional array. This is the file:
1:Name1:43
2:Name2:84
3:Name3:53
4:Name4:14
5:Name5:12
6:Name6:63...
Hi!
There are two functions in my code:
void *memcpy(void *dest, const void *src, size_t n);
in_addr_t inet_addr(const char *cp);
I want to set IP address to an 4 element array in structure:...
Thanks!
No errors or warnings
Hi!
I have a very strange problem! When I save long integer to textfile, everything works well, but when I try to read it, I get completely different value.
#include <stdlib.h>
#include...
Sorry, my mistake! I fought Unix will have thous functions as an system calls allso like in Linux!
Even on Beej's socket programming guide, socket(); connect(); bind(); etc.. are called System Calls!
OK, this is the answer that I found:
The second argument is a pointer to a struct sockaddr, that contains information about your addresses, namely, port and IP address.
But what is this?
(struct...
Everything is compiled in executable file! And socket(); connect(); are system calls, aren't they? They are not functions of some libraries!
Its not about hating Windows! and so what, that I am so stupid in programming? Allready searched all my posts? You just pointed that Unix isn't more powerfull than Windows! Do a little google search...
Thank you!
By the way, there is a book called UNIX NETWORK PROGRAMMING:
http://www.amazon.com/exec/obidos/tg/detail/-/0139498761/qid=1106316964/sr=8-3/ref=pd_ka_1/102-3278784-0943319?v=glance&s=books&n=507846...
Are you stupid or what?
Windows is crashing has buggy software, viruses, worms, trojans, big price, insecure.. and you call that a powerfull OS?
*nix has only fiew viruses, software bugs are...
Why the hell do you want to do it with Winsock? For winsock you need to link some winsock dll and initialize it with code! And if that Win computer, where you run your app, wont have winsock*.dll you...
OK, can you at least tell me what is (struct sockaddr *)&server?
Why does this line has both * and &? * is for pointer and & is when you create reference, but why are they both here?
Well, as far as I know it returns the size of an array! Am I right? Thank you!
Hello!
I know how to use connect, bind, accept, but I have no idea how they work!
For example connect(); takes three arguments:
int connect(int sockfd, const struct sockaddr *servaddr, socklen_t...
Thank you!!!
This works:
if(strncmp( &buffer[i], "l", 1) == 0){
cout << "+\n";
}
But what does &buffer mean? Why do I need to use...
Hello!
I'm creating a simple pop3 client, but the problem is that my code doesn't recognize the '+' character! I don't get it! It should work!!!
#include <sys/socket.h>
#include...
Hello!
I have little knowledge about parallel port programming on Linux. I wan't to know if its possible to like 'listen' if the current is incoming into data pin? What I need is forexample I have...
Thanks!
I allready printed them out, but last two bytes are blank. But when I print the whole text out with loop like this:
int recv_data_size = recv(...);
for(int q=0; q<recv_data_size; q++){...