18,491 Topics

Member Avatar for
Member Avatar for Alex_

Hey, i'm trying to sort direct in a file. The problem is that when i read the first time an int from it,it works! doh. but when it reads for the second time, it doesn't. ( Neither the swap works. No signs of errors from the compiler. [code=language] FILE *fp=fopen("element.txt","rw+"); …

Member Avatar for Alex_
0
948
Member Avatar for nb1

hello, I am attempting to exploit a format string vulnerability in a C program in order to 1)crash the program, 2)print out the secret[1] value, 3)modify the secret[1] value, 4) modify the secret[1] value to a pre-determined value. Here is the vulnerable code: [code] /* vul_prog.c */ #define SECRET1 0x44 …

0
57
Member Avatar for vieestchien

Hi everyone, I am new to J2ME, so I would like to get some help from you guys. I am developing an application which needs to call some C functions. Normally I would use JNI, but apparently for CLDC cellphones only KNI is available. I am willing to learn more …

Member Avatar for peter_budo
0
129
Member Avatar for riahc3

Hey :) Damn I hate pointers in C :P Worse thing possible. Anything I post my code: main.c [code] #include <assert.h> #include <ctype.h> #include <errno.h> #include <float.h> #include <iso646.h> #include <limits.h> #include <locale.h> #include <math.h> #include <setjmp.h> #include <signal.h> #include <stdarg.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include …

Member Avatar for Ancient Dragon
0
131
Member Avatar for mayu

Helloooo, i want to create a dropdown menu in c, like we hav in windows. Is there any header files available for creating a menu..

Member Avatar for jephthah
0
2K
Member Avatar for narendharg

Hello , I would request you to give some information regarding the use of LOCATOR/LINKER. With Regards Narendhar.G

Member Avatar for Salem
0
108
Member Avatar for Jishnu

Hi, I'm trying to build UART communication channel between ATmega16 microcontroller and hyperterminal. I'm using MAX232 as a level convertor between the two. See the attachment for the connection diagram. I'm using Bascom-AVR for programming ATmega16. Here's my test code, which I've copied from its help section: [CODE]$regfile = "m16def.dat" …

0
56
Member Avatar for grvs

I allocated memory to a pointer, which i had to return. So I don't know where to free it as its a local variable. I was trying to create an array of variable length (user-specified). I got some help for that in this forum only under this [URL="http://www.daniweb.com/forums/thread129324.html"]thread[/URL] here is …

Member Avatar for grvs
0
5K
Member Avatar for computerages

Hi! I have read that I can use inotify on linux, using c language, to monitor file systems. However, I am unsure how I would implement such a system. I looked up websites but it did not really help. I was wondering if someone can just show me how to …

Member Avatar for John A
0
81
Member Avatar for grvs

In C,how to define an array which is of a length specified by the user? I tried writing a code, but outputs were strange. Sometimes first two elements are correctly displayed, sometimes only first. Other seems some random values (extremely large sometimes). May be the problem is in initializing the …

Member Avatar for grvs
1
743
Member Avatar for sanchit223

I am trying to write a shared library using C but need to call some C++ functions. So I have created a shared library containing the required C++ functions. How can I call those function from C code, I tried dlopen() and dlsym() in the C code. It creates handle …

Member Avatar for Ancient Dragon
0
178
Member Avatar for zoner7

As I write my code, I am realizing there are numerous places where a type int could easily be substituted with a type char. Because type char uses less memory than its int counterpart, I am curious why people don't prefer the former more often. for example, it's not uncommon …

Member Avatar for Radical Edward
0
578
Member Avatar for driplet

Hi there: I am trying to output a single variable to a binary file, but couldn't get it done correctly. [code] result = 17.0; if ((OutFp1 = fopen("myfile.bin", "wb")) == NULL) { Application->MessageBox("File can't open.", NULL, IDOK); return; } fwrite(&result,sizeof(result), 1, OutFp1); fclose(OutFp1); if ((InFp15 = fopen("myfile.bin", "rb")) == NULL) …

Member Avatar for driplet
0
132
Member Avatar for Ancient Dragon

I think its about time we add a new MS-Windows board that is specific to MS-Windows programming. Why? Because there have been several threads in the c and c++ boards (probably vb too) that are about windows programming instead of about c or c++. [URL="http://www.daniweb.com/forums/thread129099.html"]This thread [/URL]is a good example …

Member Avatar for Ancient Dragon
0
146
Member Avatar for abhijithda

How does "\b" and "\n" work together when they are placed next to each other in printf. For ex: Printf("\naa\b\n") The solution is "aa". I was wondering if anyone could explain me how/where "\n" is placed. Does the occurence of "\n" just makes the file pointer to transfer to the …

Member Avatar for jephthah
0
292
Member Avatar for J-son

Can anybody help me to solve this problem? My program doesn't work as what it is required. Here is the question and my program code. Thanks. [CODE=c] /**Twenty-five numbers are entered from the keyboard into an array. Write a program to find out how many of them are positive, how …

Member Avatar for J-son
0
127
Member Avatar for awi123

program to display 10 multiples of a number [code=c] #include<stdio.h> main() { int m,n,o; m=5; for(n=0;n<11;n=n+1) o=m*n; printf("Multiples are %d",o); }[/code]

Member Avatar for Aia
0
132
Member Avatar for thirtan

can anyone please help me write a program to find the size of primitve datatypes in a particular complier and display the same on the screen.

Member Avatar for thirtan
0
105
Member Avatar for amarhp

Hi all, I have one question regarding pointers.. suppose..I've one pointer tht points to block of data[RAW data - may be sound file]. and i want to copy this data to another location which pointed by another pointer. so plz show me the way ..how to do tht.

Member Avatar for Radical Edward
0
94
Member Avatar for somename

Hi guys. I cannot figure out how to do next thing. for example i have a little progie like this: [CODE]int myfunction(int argc, char *argv[]){ int i; for(i=0;i<argc;i++) unlink(argv[i]); } int main(int argc, char *argv[]){ myfunction(argc,argv); }[/CODE] works fine, but i'm trying to do that: [CODE]int myfunction(int argc, char *argv[]){ …

Member Avatar for LouPascalou
0
110
Member Avatar for champnim

Can anybody please give me a link for a program to convert a PDU string to ASCII? Thanks in advance.

Member Avatar for champnim
0
140
Member Avatar for paolomontero

Hi, I'm using Turbo C 2.01 and im stuck with this problem. I've reduced it to the following. My code in Turbo C is this: [CODE=C] void f(char *); char h[] = "hello"; void main() { f(h); } void f(char *s) { int n = 0; while (s[n] != 0) …

Member Avatar for paolomontero
0
271
Member Avatar for champnim

I have a string of the form "abcd\"1234\"efgh". I want to extract 1234 from this string. How should I do this?

Member Avatar for WaltP
0
303
Member Avatar for Crushyerbones

Hello, sorry to ask, but does anyone know any working algorithms for quicksorting a doubly linked list? I'm only asking because I'm going to rip someone's head off if I have to keep doing it by myself any longer :P Don't worry, I understand how to it on my own, …

Member Avatar for Crushyerbones
0
72
Member Avatar for Borgatto

Hello. I need to create a C application and i have to use a status bar. I think i can use MFC, but i don't know how to start. Can anyone help me? Thanks.

Member Avatar for Borgatto
0
133
Member Avatar for rajkiran718

CAN any one help me writing a C Program I need to send a Http request to Http audio streaming server get connect if server requires authentication (then again send user name and password) if authentication is OK get the audio stream downloaded on to a folder Else If server …

Member Avatar for stephen84s
0
122
Member Avatar for SwathiSangral

Hello, I have a sample code which is a header file and I am trying to write a CPP program which uses this file. But I am getting errors while running the code. Here is the header file: #ifndef FineInterfacePtr_h #define FineInterfacePtr_h template<class T> class CSafePtr { public: CSafePtr( T* …

Member Avatar for Radical Edward
0
137
Member Avatar for Utter_iMADNESS

Hi everyone. I'm making a simple text rpg and battle system with C and I was just wondering if it was possible to add sounds to it. I've heard that it's possible with C++ but I'm not sure if it's possible with C as well. Any help is greatly appreciated …

Member Avatar for jantazone
0
181
Member Avatar for bobraj

hi all, i am new to programming, my problem is that after certain data manipulation i will a array which will have only zeros & ones. (example x[5]={0,0,1,0,1} now i would like to store the contents of the array in another variable like A(say)=00101. but the codes which i written …

Member Avatar for bobraj
0
151
Member Avatar for zebanaqvi

When a language is created, then i think is the interpreter or compiler written. But how are the linked at the hardware level? How is a language understood by the machine? can anyone see the code in which C is written?

Member Avatar for Ancient Dragon
0
78
Member Avatar for auzzyboy

My idea is really simple: -create a game similar to that of Deer Hunter, except you arent hunting for deer. You are hutning for squirrels. I would like some help with People experianced in C or C++. to script. <snip>.

Member Avatar for Tigran
0
129
Member Avatar for narendharg

Hello, I would request you to give some information regarding FLOAT CODE. With Regards Narendhar.G

Member Avatar for Aia
0
149
Member Avatar for fddrummer06

I am currently taking a class in C online and I have a homework assignment to create a random sentence generator with arrays of specific words. I have the random part working, but I am unsure as to how to capitalize the first letter of the first word in the …

Member Avatar for jephthah
0
818
Member Avatar for Nematoad

hey Guys and Gals, There has been lots of discussion about fopen64, fseek64 and fread64 functions in C / C++ and Linux. So Far no one has produced anything useful. Just lots of false rumors. Anyone see an implementation that I can use right now? I need it for RHEL …

Member Avatar for jephthah
0
146
Member Avatar for LightSystem

I have a simple question. Is it possible for a C variable to have a user-defined name? Imagine this: I have a function lets call it: create_new It receives a string, lets call it: name[ ] So the function looks like this: [B]char create_new(char name[ ])[/B] My question is, can …

Member Avatar for Salem
0
98
Member Avatar for achandra

hi, can anyone please tell me which is better in #include<stdio.h> and #include"stdio.h" and why? bye chandra

Member Avatar for jephthah
0
74
Member Avatar for merkuries

It's my revision question. Please help... Create a Class Employee. This class holds member variables: employee number and salary. It has an array of 4 employees and includes 4 employee number and salary. Has 2 member functions: Get() employee detail, namely number and salary Display() employee detail Create main() I'm …

Member Avatar for merkuries
0
185
Member Avatar for hazmatt

I found some open source code written in C that does most of what I want for a project and am having some trouble making the modifications I need. I am hoping the solution will help me better understand pointers and memory allocation as well. The original code takes in …

Member Avatar for hazmatt
0
141
Member Avatar for dr4g

Hi there. All mail sent through the SMTP server, i need to modify the message being sent through. I thought of making either a C,bash,perl script to take in the message, modify it and return it to SMTP, or stop the SMTP process, and re-call it from the script. Purpose …

Member Avatar for Salem
0
118
Member Avatar for mrynit

I am trying to modify code for a usb thermometer prob for linux. I have the source code and the makefile used to compile. When i use make to compile, it will compile and work just fine no problem. I am trying to setup eclipse so i can modify the …

Member Avatar for jephthah
0
279
Member Avatar for carobee

hi all i am using VC++ editor. Can anyone tell me how to insert sleep in my program? i have tried sleep(). but it is giving an warning 'sleep' undefined; assuming extern returning int. Thanks in advance

Member Avatar for Colin Mac
0
155
Member Avatar for J-son

[CODE=C] /** calculate the value of 'a' raised to 'b'.**/ #include <stdio.h> int main (){ int a,b,calc,calculation; printf("Enter value of a and b\n"); scanf("%d %d",&a,&b); calculation=1; for(calc=1;calc<=b;calc++) { calculation=calculation*a; } printf("%d raised to %d is %d",a,b,calculation); return 0; } [/CODE] My problem is I don't understand how this part " …

Member Avatar for J-son
0
121
Member Avatar for crash override

I'm creating a program that connects to an IP address on a specific port, then uses the recv() function to return the data from the address. I don't know how to go about creating the buffer the data will save to. At first I was just going to create a …

Member Avatar for crash override
0
350
Member Avatar for Zivanayi

Hello there I am a new member to this blog, I am reaally excited to join everyone here. I am a Junior programmer I use Visaul Basic I hope to improve my skills through this blog and also share the little I know. I am a 29 year old unmarried …

Member Avatar for zandiago
0
56
Member Avatar for champnim

I want to access my mobile phone,connected through its USB cable, from a C program to send AT commands to it.Can sumbody pls help me

Member Avatar for champnim
0
203
Member Avatar for tejapedada

Hi all, using C language we can read text files. we can read each and every character. ch =fgetc(filepointer); but i want to know how to read folders. for ex: fopen("c:\one foldername", "r"); in out put i want print subfolders and files. if any body know please help me... thanks …

Member Avatar for WaltP
0
127
Member Avatar for rob_xx17

hello, I have a rather old system, running Red Hat 5, and I need to write a program that, among other things, imports data from an external file(s) and writes it into array(s); the following is the format of my external data file (obviously it's much larger): [code] 2.59 3.17 …

Member Avatar for Salem
0
116
Member Avatar for dangana

This code i've written keeps showing an error "constant expression expected in function main". I'm not sure if the code i've written is on track. [code] #include<stdio.h> #include<math.h> #define MULTIPLY 1 int i,n; int operation; int Answer = 1; int main() { printf("You are welcome\n"); printf(" how many numbers do …

Member Avatar for jephthah
0
155
Member Avatar for Crushyerbones

Hi, I've been trying to analyze the source code to some applications but so far I've been unable to figure out how to receive user input while the program is of doing something else. My program consists of a small list of items which are being constantly sorted. The problem …

Member Avatar for Duoas
0
219
Member Avatar for SonxQ7

why is this giving a syntax error? [code] int function ( int x) { x ? return 1 : return 0; } error C2059: syntax error : 'return' [/code]

Member Avatar for jephthah
0
184

The End.