I just noticed that looking at the posted link. My mistake sorry! :D
Type: Posts; User: Martin_T
I just noticed that looking at the posted link. My mistake sorry! :D
Thankyou! This is what I was trying to say although I think maybe I was a little unclear. I am coding for big-endian but that's easily altered now I understand how this is done.
You help is...
Thanks for the reply.
I thought you had misunderstood me also as I knew 400 was outside the char data limit, that was my reason for posting. Also I think you mistaken in a previous post about a...
Thanks for your reply.
In the application I am using it within I have to use a char array to store my data.
The first two characters are required to hold an 'ID' field.
So I need some way...
yes I'm familiar with the bit shift operators. Will this help?
As laserlight says it is possible to assign this way, I have this part working in a test program. I just can't operate on two bytes...
I have read up on bit manipulation and understand it fine i.e. How to set certain bits, get certain bits, shift bits etc etc.
However what if the bits are across two bytes? e.g.
char a =...
I understand, using sockets, how I can tell that the server has been disconnected..... is there a way the client can retry connecting for a given time automatically before giving up??
Finally got some time to do some work on this... So where i'm upto.
The client can request to register. This sends a packet to the server with a header 'R'. The server then stores the details in a...
thankyou. i think your 100% correct. I dont need the for loop do i. Il try this as soon as am back at comp. Am on phone at the minute.
MK27, once again you come to my rescue. It is really appreciated.
Not sure if it's just me but the site availability seems bad tonight. Keep getting a database error returned.
Thanks for the...
It is a client/server environment. The way I have it setup is that the server is passed a whole "logon" string including username and pasword. From that I need to getUsername to check if the user...
int main(void)
{
char user[50] = "testuser@123456";
char userTwo[50] = "jabman@999";
printf("\n\nUser string created");
registerUser(user);
printf("\n\nUser registered");
...
I'm only starting out myself but you may get more suggestions if you say what the error is you are experiencing
#include <stdio.h>
#include <string.h>
const char *seperationChar = "@";
void getUsername(char *usernamestring)
{
char *c = usernamestring;
the header suggestion really helped me. I now can sent a message from a client and the server will recognise the action required. However just wondering how to deal with the user registration...
I'm confused. If your saying you can't use "==" for string comparison in C then we agree. I had to use strcmp to get my code to work.
Sorry yes, I was just wanting to post what I found in case anyone was searching and came across the same problem. I have solved the issue.
In case anyone has the same issue.
I did read it. However if you read my post you'd see I said I was new to C and struggling with the concept and usage of pointers.
Thanks for reply. However,
I tried doing
char input = argv[1];
and i got :
I'm struggling with the whole pointer concept at the moment. For example I have a piece of code for testing the first char of a command line arguement but I can't get it to work.
I have tried...
Thanks! I've now declared them, for example :
char string[50];
is this bad practice?
Sorry, I am quite new to C and have not quite got to grips with the pointer stuff.
Originally I had
char username;
char password;
char *username;
char *password;
printf("\nPlease enter your new username : ");
scanf( "%s", username);
printf("Please enter your password : ");
scanf( "%s",...
printf("\nPlease enter username : ");
scanf( "%s", &username);
printf("Please enter password : ");
scanf( "%s", &password);
send(sockfd, &username, strlen(&username), 0);...