Forum

Posts

RECENTLY INDEXED PROGRAMMING SOLUTIONS OF C Language


Issue with .so (Shared Object) Files  

Hello there! I'm dealing with a piece of C code today, which is supposed to run in MATLAB. Thus, I intend to make use of the MEX interface. However, first - the c... Continue Reading
Views : 93
Wednesday 19th of September 2012

Expansion  

Hi, I'm working through the problems in K&R and I'm having difficulty with a particular one. Code: /*Write a function expand(s1,s2) that expands shorthand notations like a-z in thestring s1... Continue Reading
Views : 95
Wednesday 19th of September 2012

need to solve simple c problem  

Problem Name: Y = MXEveryone know that the equation of a straight line is Y = MX + C. But if C = 0, then the straight line is passing through the origin. Here I always put C = 0. So our equation will be always Y = MX. Straight line is a geometrical term but my problem is not geometrical. I... Continue Reading
Views : 126
Wednesday 19th of September 2012

wnat to know some logic about gcd  

i can calculate gcd between 2 and 3 number but how can i calculate gcd multiple nuber i,e 10 number 20 number .i need logic and idea. possibly help me for coding.here is my effort. i want to modify it for calculate multiple number. Continue Reading
Views : 109
Wednesday 19th of September 2012

Splitting up my Gosper's Algorithm into multiple Functions  

Code: // Required Libraries#include #include #include // Program Defined Specifics#define PROGRAMMER_NAME "Leigh McKenzie"#define PI 3.14159#define E 2.7182818284;// Start... Continue Reading
Views : 78
Wednesday 19th of September 2012

having a little trouble with my program  

I am a beginner and arrays/functions are giving me a bit of trouble. I a trying to find the highest midterm score and highest final score and pass it back from the function and print. I am also trying to pass the results back as an array. Can anyone help? ... Continue Reading
Views : 164
Wednesday 19th of September 2012

Return value of sscanf  

Hello everyone, I wanna ask that what is the meaning of the return value of sscanf? I've seen people use sscanf return value to check their string.. eg. Code: if(... Continue Reading
Views : 120
Wednesday 19th of September 2012

Help with looping  

Hello, I have the following code that works great: Code: #include int main(void){int v=1;int dist=1;int i = (500 / 100);float r = 0.05;int val = 20;float R = 0.05 *... Continue Reading
Views : 118
Wednesday 19th of September 2012

Table lookup for functions..  

hey guys im trying to make a table look up for a collection of functions so i have chosen to use a table look up with a function pointer run by a 2 character string.. Code: const struct Node{ ... Continue Reading
Views : 111
Wednesday 19th of September 2012

Function returning function pointer : help  

I wrote following program,Its compiling without errors but giving wrong output.output should be 2 but giving 0;Can anybody tell me what is my mistake?Thanx in avd. Code: Continue Reading
Views : 208
Wednesday 19th of September 2012

porting C code in MIPS  

Hi, i am new to C programming, and want to advice you in general about good tips in order to port C code in small processors like MIPS. for example what is a good practice in order to replace functions like malloc? Also , is there any easy way to monitor if the... Continue Reading
Views : 77
Wednesday 19th of September 2012

allocate memory for constant string  

I have a struct Code: struct animation { char *name;} I am entering the animation names manually, e.g. "standstill" I want to allocate memory depending on the size of... Continue Reading
Views : 107
Wednesday 19th of September 2012

Experimenting with SSL connections  

you, the client, have to compare the certificate against a list of trusted certificate issuers and their public key. for example browsers maintain a list of trusted certificate authorities. your client code has to maintain such a list or get it from somewhere. here is a link that describes the... Continue Reading
Views : 121
Wednesday 19th of September 2012

Linked list  

Hi.. i would like to know why this code is working : Code: Continue Reading
Views : 90
Wednesday 19th of September 2012

How can I get input to stop at 'Esc' instead of \n   

I'm using Code::Blocks 10.05 in Win XP SP3. How can I get input to stop at 'Esc' instead of \n ?This is the line of my code I'm having trouble with: Code: fgets(entry,... Continue Reading
Views : 90
Wednesday 19th of September 2012

[HELP] Deal Or No Deal game.  

I've been having a problem on how to get started in programming this game, and the deadline is tonight after 8hours. Im making a deal or no deal game . heres my source code at the moment. Continue Reading
Views : 85
Wednesday 19th of September 2012

serial communication and general issues  

Hello Everyone I'm a newbe to these forums and my apologies if i post a few threads in wrong sections for these boards. I have learnt c a few months back and have got... Continue Reading
Views : 184
Wednesday 19th of September 2012

C String manipulations with switch statement  

I'm very new to C programming, but I really need help with this assignment and the tutoring lab at my school wasn't much help. I need to write several functions in C to work with a switch statement to manipulate strings. There needs to be one to return the character in the string with the largest... Continue Reading
Views : 89
Wednesday 19th of September 2012

My idea.  

So, basically i'm new to programming especially in C. I can do web scripting, so I'm not completely new to the concept of programming.But right now i'm a student in a computer engineering degree. I missed out on the C programming class I was supposed to take this summer, and one of the classes... Continue Reading
Views : 89
Wednesday 19th of September 2012

crashes during run time  

why is the program crashing when I change 3000 to 4000 on this line char arrFilename[3000][MAX_PATH + 1]; Code: #include #include #include #include... Continue Reading
Views : 113
Wednesday 19th of September 2012

Help with symbolic constants  

Below is my code for a beginning type project. I am asking for help with defining constants. What other constants can I include or what variables can I change to constants. I have muddled over this for a while and would like some input from my fellow c programmers. Also, this is a project that was... Continue Reading
Views : 180
Wednesday 19th of September 2012

does this compile for anyone  

I am getting an error message that I think is a problem with gcc, not the code itself. Thanks. Code: /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o||In function... Continue Reading
Views : 135
Wednesday 19th of September 2012

dup question - file io  

Lets say i want to use an execl call to netstat and then pipe it to a file. I know i could use dup like so: Code: int fd = open("string.txt", O_CREAT | O_RDWR, 0755); if(fd < 0)... Continue Reading
Views : 101
Wednesday 19th of September 2012

[HELP] Force stop for input  

What are the ways to get a string input from user that stops accepting input when the input's length is already 30 without the need to press ENTER or any other keys. Maybe you can show some code? My first attempt is to use: Continue Reading
Views : 144
Wednesday 19th of September 2012

fprintf isn't outputting anything to file  

I am trying to use the following c code to print out an array that I have passed in. It should output the text in hexadecimal format one on each line. When I first wrote it, I had no problems with it working I opened the output file and my array was there. I changed the fileOutName parameter and... Continue Reading
Views : 127
Wednesday 19th of September 2012

Urgent helpppp!!  

Im so bad in Cprogramming and i need help in this question iRent, a fictional car rental company, is currently having a promotion advertised as ?rent 3 days and drive 1 day free?. The fine print reads that 1 day within each 4-day block is free. This means that there is no discount for a... Continue Reading
Views : 122
Wednesday 19th of September 2012

Geometric search/intersection problem  

Hello guys. I decided to post this in the C forum since its what I use, but its really a general problem. Please feel free to move it to the appropriate forum if needed (I have also asked the same question in dreamincode.net and devshed.com) I need to find if a any given... Continue Reading
Views : 112
Wednesday 19th of September 2012

Inserting EOF in Binary File using C  

Hi, I am facing problem in inserting EOF character at the end of the binary file. I read CTRL+Z for windows but it doesn't work. First of all I want to ask that does fclose(SOME FILE POINTER) not automatically insert EOF at the end of file???? Below is the approx.... Continue Reading
Views : 94
Wednesday 19th of September 2012

Parallel threads for socket send/recv.  

Hello all, I want to create parallel threads for socket send/recv in windows and linux instead of managing them in a single thread using select. I am expecting that this will increase the performance of my program. I have the following doubts regarding this design: Can we... Continue Reading
Views : 125
Wednesday 19th of September 2012

datatype deduction  

Without the prior knowledge that integers store 2 byte in C,or char store 4 byte,float reserves 'so and so bytes',...etcIs it possible to deduce directly from a C program which datatype store what amount of free memory? I tried this code but it was without any results.(As... Continue Reading
Views : 82
Wednesday 19th of September 2012