프로그래밍 QnA

살자의 이미지

network 통신시 read에 대한 질문입니다..

안녕하세요..
저는 지금 간단한 서버를 만들고 있는데요..

서버에서 read를 하는데 궁금한 점이 있어서 질문 올립니다..

#define MAXSIZE 4092
...

 readbyte = read(sockfd, buff, MAXSIZE);

에서 client가 MAXSIZE인 4092 보다 작은 100 만큼의 data를 보냈는데
read에서 돌아옵니다..

제 생각에는 4092 만큼 버퍼에 찰때까지 기다려야 하는것이 아닌가여?

고수님들의 답변 기다리겠습니다..

mymam77의 이미지

파일 업로드 하는 소스 좀 부탁드립니다.(그림 첨부)

위의 그림과 같은 기능을 하는 jsp 소스 구할 수 없을까요?

위의 그림은 사진을 업로드 하는 것인데 대신 파일을 업로드 하
는 소스를 원합니다.

부탁드립니다.

lsj0713의 이미지

A Book on C 1장 연습문제 17번...

[code:1]
/* Compute a better average. */

#include <stdio.h>

int main(void)
{
int i;
double x;
double avg = 0.0; /* a better average */
double navg; /* a naive average */
double sum = 0.0;

printf("%5s%17s%17s%17s\n%5s%17s%17s%17s\n\n",
"Count", "Item", "Average", "Naive avg",
"-----", "----", "-------", "---------");
for (i = 1; scanf("%lf", &x) == 1; ++i )
{
avg += (x - avg) / i;

toold의 이미지

이 warning 의 의미는 무엇인가요...

경고나는 부분의 소스는 아래와 같구요...

if((fp=fopen(md5_addr, "r")) != NULL){
	bzero(file_buf,BUFFSIZE);

	while((l=read(fp, file_buf, BUFFSIZE))>0){
		write(acceptSD, file_buf, l);
		bzero(file_buf, l);
	}
}

경고 내용은 아래와 같습니다..

test.c:199: warning: passing arg 1 of `read' makes integer from pointer without a cast

어떤 부분이 이상한걸까요...ㅠ.ㅠ...

geneven의 이미지

C언어에서 Call by value 이런형식도 되나요?

void a(char *abc)
{
....
}

main()
{
    a("afaf");
}

그러니까 문자열을 함수로 받을때 포인터로 받는거요

closeyes의 이미지

gtk+ for windows를 사용하는 방법좀 알려주세요~

[code:1]Redistribution on other web sites, CD-ROM etc
You are welcome to redistribute the GIMP on other web sites, CD-ROM, and other media. You don't have to ask for permission. That's one of the points of Free Software. One important thing that the GNU license requires is that you must also redistribute the source code. This means the GIMP, GLib, and GTK+ 1.3.0 sources from this site (ftp.gtk.org is the same site as this). Also the libiconv and gettext sources from some GNU mirror must be redistributed.
Installer
There is a GIMP installer that contains the appropriate stuff from these zipfiles (or relatevely fresh previous versions) at http://www2.arnes.si/~sopjsimo/gimp/. That installer is created by Jernej Simoncic, so please ask him about problems with it.

closeyes의 이미지

gimp를 쓰는 용도가 머조?

전에 c로 만들어진 그래픽 라이브러리가 없냐고 질문을 올렸는데요
많은 분들이 gimp 가 있다고 해서 받아서 사용해봤는데
포토샵같이 그림에디터 역활만하는것 같아서요.

정확히 하는 역활이 먼가요?

nan392의 이미지

Stevens 책에 있는 예제인데 빠진 코드가 있는거 같아서요..

안녕하세요 다들~ :D
다름이 아니라 UNIX programming을 stevens씨 책으로 공부중인데요
안에 포함된 라이브러리중 path_alloc이란 함수에 코드인데요
아무리 보아두 마지막 malloc하기 전에 size 변수가 NULL값인지 체크하는 부분이 빠진거 같아서요.
소스 코드는 다음과 같습니다
[code:1]#include <errno.h>
#include <limits.h>
#include "ourhdr.h"

#ifdef PATH_MAX
static int pathmax = PATH_MAX;
#else
static int pathmax = 0;
#endif

#define PATH_MAX_GUESS 1024 /* if PATH_MAX is indeterminate */

seeker의 이미지

프로세스 실행중 메모리 계속 증가.

unix c 프로세스에서 메모리가 계속 증가하는데
어는 부분에서 그런지 알수 있는 tool 이나, 프로그램
있으면 알려주세요.

감사합니다.

purewell의 이미지

ODBC에서 SQLGetData로 받아올 필드 길이 구하기?

데이터베이스 관련 라이브러리를 짜려고 합니다.

bool GetString (std::string& strRet, int nCols)
{
  ...
  SQLGetData (...);
  ...
}

문제는 ODBC라이브러리는 std::string을 지원하지 않습니다.

받아올 필드의 길이(nSize)를 계산해서

char* pData = new nSize;

한 뒤에 strRet에 복사해주려고 합니다.

이때 nSize를 구하는 방법을 알고 싶습니다.

페이지

프로그래밍 QnA 구독하기