Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
~10.8K People Reached
Favorite Forums
Favorite Tags
c x 51
c++ x 8
Member Avatar for asilter

let's say we have a unsigned char pointer with allocated memory of 1 million bytes. Could you give a little code sample which shows how to eliminate first 1000 bytes? the little similar situation is like below: unsigned char array: 12,34,67,99,215,250,123,67 i want to make it: 215,250,123,67 I want to …

Member Avatar for IcantC
1
173
Member Avatar for asilter

I did not care on warnings. But they put me in trouble lately. When compiler comes to the statement below it gives the warning. [code] /* void ** vpSec00 comes as an argument */ int hSec = 0; size_t nbytes; *vpSec00 = bitio_o_close(hSec0, &nbytes); [/code] it says: warning: assignment makes …

Member Avatar for SphinCorp
0
291
Member Avatar for asilter

i have 2 executable files. From one of them i'm calling the other one. it is also executed correctly, but does not return 0. why? backup.c file : [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/time.h> #include <unistd.h> #include <mysql/mysql.h> int main(int argc, char * argv[]) { if(!execl("/home/user1/exec_work/binary","/home/user1/exec_work/binary","serdar","ilter",NULL)) { …

Member Avatar for Duoas
0
114
Member Avatar for asilter

Hi, The system under my program is using MySql version 4.0.18. I want to have a documentation for using [COLOR="Red"]MySql Transactions API[/COLOR] from my C program. Could you give some link? thank you.

Member Avatar for Ancient Dragon
0
79
Member Avatar for asilter

i have a loop displaying current number of file which is being created. [code] for(i=1;i<=nFileCount;i++) { ... printf("%d. file has been created\n",i); } [/code] but i dont want the display to write ". file has been created." again and again as a list. I want only the i change. how …

Member Avatar for Salem
0
91
Member Avatar for asilter

unsigned int is 4 bytes in the system i'm programming. i printed sizeof(unsigned int) and it said 4. [code] int main(int argc, char * argv[]) { unsigned int a = 0; long int b = 2607503366; /* the b data type must strictly be a long int */ a = …

Member Avatar for Salem
0
112
Member Avatar for asilter

[code] unsigned int nBolum = 0; unsigned long nKalan = 0L; unsigned long ulA = 0L; unsigned long ulB = 0L; ... printf("ulA=%u\n",ulA); printf("ulB=%u\n",ulB); nBolum = (unsigned int) ulA/ulB; nKalan = (unsigned long) (ulA%ulB); printf("nBolum = %u\n",nBolum); printf("nKalan = %u\n",nKalan); ... [/code] it prints; [code] ulA=2607503366 ulB=16777215 nBolum = 155 …

Member Avatar for Salem
0
151
Member Avatar for asilter

[code] unsigned long nBolum = 0L; unsigned long nKalan = 0L; unsigned long ulA = 0L; unsigned long ulB = 0L; ... printf("ulA=%u\n",ulA); printf("ulB=%u\n",ulB); nBolum = (unsigned long) ulA/ulB; nKalan = (unsigned long) ulA%ulB; printf("nBolum = %u\n",nBolum); printf("nKalan = %u\n",nKalan); printf("HVFE.c exiting\n"); exit(1); [/code] it prints : [code] ulA=2607503366 ulB=16777215 …

Member Avatar for asilter
0
3K
Member Avatar for asilter

my program is written in c and compiled and linked with gcc. In normal way; i execute it by giving an argument after writing executable. [code] ./my_executable abc.dat [/code] and it works. i need to execute it in gdb debugger. how will i give this abc.dat argument to the gdb …

Member Avatar for dwks
0
97
Member Avatar for asilter

[code] #include <iostream> using namespace std; int main(int argc, char * argv[]) { hash<const char*> H; cout << "foo() ->" << H("foo()") << endl; } [/code] compilation error after g++ -c -g main.cc is : [code] main.cc: In function `int main(int, char**)': main.cc:8: error: `hash' undeclared (first use this function) …

Member Avatar for vijayan121
0
353
Member Avatar for asilter

i'm trying to read and understand a .cc (c++)file, i want to know what does ok_flag(false),time_range(false),prefix() do after ":" ? I did know that ":" was being used for class inheritance but what is ":" for in the bleow code? [code] ClassA::ClassA(const char *db) : ok_flag(false),time_range(false),prefix() { //.. Constructor statements …

Member Avatar for asilter
0
142
Member Avatar for asilter

when the user clicks on a link to download a file form the server, is there any way of getting information whether his download is complete or not? or can there be an exposed active x event handler of download status, so that linking with javascript and AJAX could send …

Member Avatar for Ramy Mahrous
0
66
Member Avatar for asilter

i have a .so(shared object) file and i want to debug into it. could you plz give a little gdb debugger code sample which is adding a shared object for debugging. PS : My executable is Test.x and I know to start with [code] gdb Test.x [/code] :) could u …

Member Avatar for TkTkorrovi
0
76
Member Avatar for asilter

how do i send a multidimensional char array to a function. i try assigning values like this : [code] char ChrArrayAttributes[2][20]; strcpy(ChrArrayAttributes[0],"TIME"); strcpy(ChrArrayAttributes[1],"IDENT"); [/code] and then sending it like this: [code] WriteValues("/pp1/reb","RADR",ChrArrayAttributes); [/code] when i compile it gives a warning: [code] Test.c:115: warning: passing arg 3 of `WriteValues' from incompatible …

Member Avatar for Salem
0
80
Member Avatar for asilter

when i, [code] g++ -c Serdar.cc [/code] compiler says: [code] Serdar.cc:3: error: semicolon missing after declaration of `Serdar' Serdar.cc:4: error: ISO C++ forbids defining types within return type Serdar.cc:4: error: two or more data types in declaration of `SetValue' Serdar.cc:4: error: prototype for `Serdar Serdar::SetValue(const int&)' does not match any …

Member Avatar for iamthwee
0
232
Member Avatar for asilter

[code] typedef map<string, Attr_info, less<string> > AttrMap; [/code] i do not know what "map<", less and ">" represents? What I little understood from the code is AttrMap is a collection of Attr_infos. If so how can i add a Attr_info into AttrMap? could u plz help? thanx

Member Avatar for Salem
0
77
Member Avatar for asilter

how to tell more than one include folders to the compiler Makefile : [code] CC = gcc CFLAGS = -I../include HVFUTILCFLAGS = -I/home/empress/HamVeriFeeder/hvfutil/include/ all: HVFE.o RdbMapping.o BUFR_Encoder.o clean: rm -f BUFR_Encoder.o HVFE.o RdbMapping.o ../lib/libhvfe.a *.bufr *.dat BUFRENCODER_CFLAGS = $(CFLAGS) $(HVFUTILCFLAGS) BUFR_Encoder: BUFR_Encoder.o $(CC) -g -c BUFR_Encoder.c $(BUFRENCODER_CFLAGS) HVFE: HVFE.o $(CC) …

Member Avatar for asilter
0
196
Member Avatar for asilter

[code] CC = gcc CFLAGS = -I ../include/ LD = gcc EmpCC = empcc HVFUTILLDFLAGS = -L/home/empress/HamVeriFeeder/hvfutil/lib -lhvfutil all: BUFR_Decoder.o HVFD.o BUFR_Printer.o clean: rm -f BUFR_Decoder.o HVFD.o BUFR_Printer.o ../lib/libhvfd.a ../bin/BUFR_Printer BUFR_Decoder: BUFR_Decoder.o $(CC) -g -c BUFR_Decoder.c $(CFLAGS) HVFD: HVFD.o $(CC) -g -c HVFD.c $(CFLAGS) BUFR_Printer: BUFR_Printer.o ../bin/BUFR_Printer $(CC) -g -c …

Member Avatar for Salem
0
93
Member Avatar for asilter

could u plz give 4 little files-sample (c and c++ code and header files) which shows how to call c++ class public member function. thanx.

Member Avatar for Salem
0
125
Member Avatar for asilter

Variables in the data structure changes when they were sent to CreateRawDataBUFR at runtime. With gdb debugger, just one line before CreateRawDataBUFR, I print the value of rdi.sIdentName, rdi.sRawDataFilePath and rdi.sRawDataFileName to the screen, they are "IST" and "data/" "IST050906125859.RAWADM9" accordingly. They are true. But after i send the address …

Member Avatar for asilter
0
162
Member Avatar for asilter

Hi, I want a char array to point the memory location, which is pointed by a char pointer, without memcpy. I mean I do not need to copy all the elements again to another location [code] typedef struct { long size; char data[1000]; }bulk; bulk blob; [/code] this doesn't work …

Member Avatar for Hamrick
0
81
Member Avatar for asilter

Header asks the question. my include files are in /abc/bcc/include/ path which are used in programs like; [code] #include "radar.h" [/code] I think, -? option will tell the compiler to do that. Could u plz give a little compiling sample with gcc. Thanx.

Member Avatar for Salem
0
95
Member Avatar for asilter

[code] 105(decimal) = 01101001(binary) [/code] for example, i want to skip first 3 bits of binary and get the number to the right and assign it to an integer: [code] 01001(binary) = 9 (decimal) [/code] could you plz give a little code sample? thanx.

Member Avatar for WaltP
0
242
Member Avatar for asilter

i'm sending a NULL pointer of type unsigned char to a function. i allocate space for this pointer in the function and return nothing. [code] unsigned char ucBufr = NULL; Allocation(ucBufr); [/code] [code] void Allocation(unsigned char * ucBufr) { /* nDataSize and ucData is got from a file here. */ …

Member Avatar for Hamrick
0
122
Member Avatar for asilter

i have a char array of 4 elements : [code] 00000000 00000000 00000010 00000111 [/code] how can i assign these bytes to 4 byte integer (this means 519), could you please give a modular code sample? thanx.

Member Avatar for ashishtrivedi
0
3K
Member Avatar for asilter

how do i assign -let's say number 12000- to 3-byte stream? could u plz give a little code example? thanx.

Member Avatar for ssharish2005
0
138
Member Avatar for asilter

how can i convert a void array to unsigned char array? could you plz give a little sample?

Member Avatar for ssharish2005
0
118
Member Avatar for asilter

[code] /* One file can be hundreds of MBs. So, 640 MB in maximum*/ int nMaxByteCount = 64000000; [/code] I read files to get binary info in it. But I don't know the exact sizes before reading. So, I allocate nMaxByteCount for large files first and get support from fread …

Member Avatar for Salem
0
100
Member Avatar for asilter

BulkData structure is this: [code] #define MAXSIZE 64 typedef struct bulk_data { char data[MAXSIZE]; struct bulk_data * next; }BulkData; [/code] In my program, I'm mallocing a pointer in 16 bytes: [code] BulkData * bdWaitingToBeCopied = malloc(16); bdWaitingToBeCopied->next = NULL; [/code] So, is this a overflow? And another question: if it …

Member Avatar for Ancient Dragon
0
121
Member Avatar for asilter

[code] RadarData * rd = NULL; rd = GetRadarData(sFileName); /* Here the debugger says that : rdp->llBdContent.bdContent.next = 0xa13f080. This is ok,but... */ CreateHVFERadarBUFR(&rd); [/code] GetRadarData is here: [code] RadarData * GetRadarData(char * sFileName) { short int nRadarSubtypeInFile; short int nRadarTypeInFile; /* Radar Data Structure */ RadarData rd; /* Radarin …

Member Avatar for asilter
0
126