well i m not saying its the function fault I was just curious why memset when i pass to buffer it fixes it now i now that i Should also add +1 for strlen to add the Null character to the string
Type: Posts; User: lolguy
well i m not saying its the function fault I was just curious why memset when i pass to buffer it fixes it now i now that i Should also add +1 for strlen to add the Null character to the string
also today i Noticed while coding that send doesnt send Null terminator with send itself you have to add strlen(buffer)+1 maybe thats the case with memset
Hello I just downloaded few sources in networking in most of them they do
memset(buffer, 0, sizeof(buffer));
and after that recv the buffer
I had a problem before in a program but when i added...
why is it safer than scanf ?
i hope this helps
i used getchar in it for scanning the char
#include <stdio.h>
#include <ctype.h>
int main(void){
char c;
for(;;){
puts("AIRLINE RESERVATION SYSTEM \n"
s_scanf reads from an array right not normal int ?
ya i just tested it works with
char arr[256]={67}
but fills only arra[0] not all array other will be NULL
it compiles on my machine with gcc
since u didnt yet do pointers u can by return values here simple code to demonstrate it
#include <stdio.h>
int calculate(int num,int nums)
{
float x;
return x=num +nums;
}
wouldnt it be go to the function and get intilised as stuff ?
then when its put to my function it will be alrdy intilised to int ?coz its a void ptr?
but ptrs to void can be ptrs to anything srry for fflush i think its a habbit i need to get rid of it
i get msv6 this error
C:\the test\main.c(16) : warning C4700: local variable 'y' used without having been initialized
shouldnt alrdy y be intilised ?
hey guys it was my first time using void as parameter my code fails hardly though i dunno whats the problem in failing
i m srry had problem in return code
#include <stdio.h>
#include...
i m trying to code a program in whish the server will connect to the client so thats y i want the client to accept all connection on that port ?
i m trying to code a program that accept any connection but on specific port is that possible ?
you should ident your code lil bit and put instead of z put num coz thats ur equation whish sum = x+y
should it fix it or only detect if there its right or not ?
i coded a fix program for it
#include <stdio.h>
void string_fixer(char *buffer)
{
int i;//loop counter
...
i m srry guys i searched google but msdn i didnt rlly understand it thanks for helping in advanced.
you can do it like this 2
void base_genrator(int num)
{
switch(num){
case 2:
binary_base
codegoeshere
break;
srry 1 more question does recv in non blocking same as blocking i mean it returns smaller or = to zero if it failed ?
i did in main thats y before it crashed coz i didnt intilised it before
oh i forgot WSAstartup stupid me :D
also i thought that will just connect it wont like send or recv something ? but program just crash after running
i changed that to tcp but now how can i connect after i got it intilised?