15,551 Topics
| |
how to print the min value from an array ? i just understand the logic of printing max value, i tried so much to print the min but didn't find any clue... here is the program for max value: [CODE] int main(void) { int num[5]; int i,max=0; for (i=0;i<5;i++) { … | |
| I have some data in the memory which is pointed to by a pointer (ptr2data), how do i pass this data to a function which accepts unsigned long/DWORD data types? [code] unsigned long* ptr2data; DWORD temp; ptr2data = (unsigned long*)&SomeArrayOfData[4]; temp = (DWORD) tempSerNum; AddDevice(7, temp); [/code] The above code … |
Hi everyone, I'm trying to code a program that uses RSA to encrypt your message. I assume you know it but if you don't know let me explain simply: [QUOTE]Your enter a word (actually it is a sentence but for now a word) then program will convert letters to numbers … | |
Please see this program: [CODE]float area(float); void main(void) { float radius; printf ("Enter Radius"); scanf ("%d",&radius); printf ("Area is %f",area(radius)); } float area (float rad) { return (4*3.142*rad*rad); }[/CODE] please explain the above program, there no value has been assigned for [iCODE]rad[/iCODE] then what does it mean ? why it … | |
[Linker error] undefined reference to `__cpu_features_init' comes to [CODE]#include <stdio.h> int main(){ char c; printf("Hello World!"); scanf("%c", &c); } [/CODE] I don't think that it's code problem. What can I do? (Dev C++ newest version) (I tried reinstalling DEV C++) | |
As you see at below I used "-1" as my sentinel value but my program wants the other 6 values i asked for in scanf too. How can i solve this problem? I just want the user to enter -1 and exit my loop. I would greatly appreciate for your … | |
Hello, there. I'm trying to write a program which reads student information from keyboard and does some calculations. I've just started it and I dont know much about this "Struct" topic. As far as I know, I've tried to do something and here is the result. [CODE]#include <stdio.h> #define N … | |
Hi Im new to this comunity and Im in throuble with C heheh. My problem is that: Im using LUA to create scripting capabilities do my software in C. So, I ve created a file called script.c to suport all script code of my project. See: [B]script.c [/B](some lines) [code] … | |
Need help for simple program, don't have a clue about C. Please, can you help me? I have 3 errors - Undefined symbol i - Undefined symbol y and - Compound statement missing See the program bellow: [CODE]#include<stdio.h> #include<conio.h> #include <math.h> void main( ) { float a, b, c,x3; float … | |
I have 3 files. variables.h, variables.c, and dictionary_test.c. How would I use my variables.c to get information from variables.h and dictionary_test.c? I'm not supposed to touch the variables.h and dictionary_test.c. I gotta do all the work in variables.c. This is the variables.h. [CODE]#define MAX_VARIABLE_LENGTH 15 /* Set the variable with … | |
how do i get the child id without calling wait? is there a way to put wait information back so another waitpid can get it...? [CODE] void sigchld_handler(int signo) { pid_t p = wait(NULL); ... } [/CODE] | |
I have this error, " lvalue required as left operand of assignment," for line 10 where scanf command appears. I can't figure out a solution to it. [CODE]#include <stdio.h> int main() { int start; char delay; printf("We're close to blast off.\n"); printf("countdown initiated"); scanf=("%d", &start); do { printf("T minus %d … | |
I am writing a simple code in c to extract the values from string for ex-P23V32 gives me output of 23*32. But when I am trying to use the isalpha() and isdigit() to check whether the value is a charecter or a digit, the compiler return always zero. Here is … | |
Hey Im doing a loop with somthing similar to this: [code=C] char stn[25]; do { printf ("Insert a number:\n"); gets(stn); }while (stn!="123"); if (str=="123") { printf ("Good value!"); } [/code] Now if I input 123, it enters the if that prints "Good value!" and the program ends naturally. Now if … | |
Hi to all, I have a problem and can't understand why this happen... I'll explain all now. I'm not a very good programmer, I'm just starting and I'm doing a program that must run on linux like a daemon. The job of this program is to take all the characters … | |
hi... 'm findin it difficult to access system date in a c program.. pls help me... N also to write code fo airline reservation in c... | |
Hi, Im a novice and im implementing a mp3 player. Im using the concept of doubley linked list for moving between songs in the directory... I have enclosed the code also.. the error i get is next_previous.c:80: warning: assignment makes integer from pointer without a cast next_previous.c:81: warning: initialization makes … | |
Hello All... To be honest, this is a bit overwhelming, but I'm hoping that someone might be able to steer me in the right direction. I am currently taking a correspondence course in Computer Programming, and without instructional support, am finding that the material can be somewhat overwhelming. I'm looking … | |
I need to create my own function to compute the cos of an angle (given in radians) using the Taylor series. The task is to create a function in which a float value is passed to it, and a double gets returned. My program compiled, but I am getting wrong … | |
Hello, So my problem is that I am supposed to write code in order to prove whether or not text in a file is topologically sorted correctly. I have the algorithm on how to do this, but the specifications say that I should use an array of lists to keep … | |
Hi we have a buffer say [COLOR="Red"]char array.[1].[/COLOR]so the size will be 1 byte. Now our problem is say we have 8 bits data say 10110101. now this must be assigned to array[0] variable as 1 byte. bit manipulation is not happening.kindly help us in this regard If possible post … | |
I'm trying to create a maze with a mouse inside moving up down left right in 200 moves. I've got everything working besides the fact that it duplicates the heart on the other side(If it exits on the left, it'll be duplicated at the right end) when the heart shape(mouse) … | |
Hello this is my first thread on the forum i tried to search everywhere for a solution but no result...:'( Im trying to figure out some easy pointer use but still get some stupid error... My fault. error C2440: '=' : cannot convert from 'char (*)[100]' to 'char' [CODE] void … | |
hello everyone, i have been given a task in my class to create a student database. it has to be able to allow a user to enter a class code, class name and a linked list of students enrolled in the class. the struct we have been given to use … | |
I am getting unpredictable behaviour from malloc(). Here is the code fragment: [code=c] float **t; t=(float **)malloc(sizeof(float *)*A); perror("\nError status 1:"); for(i=0;i<600;i++) { t[i]=malloc(sizeof(float)*B); } perror("\nError Status 2:"); [/code] The objective here is to have a dynamic 2D float type array. For testing purposes though, I have hard coded the … | |
| Hi. I'm trying to call a function to convert a decimal integer into a binary number (stored as an array of integers). Before I knew that I couldn't return an array, this is how I thought to implement it. Can anyone help me understand the way I'm actually supposed to … |
Hey guys, Im new here so I hope this post is in the right spot. Im trying to get my code to callout to the other functions. When I debug the code, it only executes the Int Main section of my code. Can someone help me out and explain how … | |
i m using char pointers to take data from char arrays of 4096 bytes and storing them into a file. the problem is............ if the data consist of only one buffer than the two datas are same but if there are more than two buffers than the data is different … | |
hi, i have problems using exec(), I need to pass a set of numbers using exec to another program that is supposed to use them to calculate something,,, i dont know how to pass them any suggestions?? | |
Hello, 1) I am trying to run gprof on the following code snippet: [CODE]int fc() { while (1); return 1; } int main () { fc (); return 1; }[/CODE] 2) compile: gcc -pg tmp.c 3) Execute gprof -a a.out 4) Fails with the following error: gmon.out: No such file … |
The End.