15,550 Topics

Member Avatar for
Member Avatar for aasi007onfire

i find this clock() function can be used to find the execution time between two particular statements in the code.... how to find it for the entire program,,, i mean right from the time the program is loaded and other OS and compiler related stuff............

Member Avatar for Aia
0
69
Member Avatar for aasi007onfire

"We can also have null statements by just including a ; or let the switch statement fall through by omitting any statements (see e.g. below). The default case is optional and catches any other cases." i found these lines about the switch case statement in a site.... i couldn't understand …

Member Avatar for Narue
0
112
Member Avatar for nalinibh

Hello, Please do anyone among you know about c software execution optimization.. thanks

Member Avatar for Salem
0
95
Member Avatar for aasi007onfire

i found that the limits of int and short int are the same........ i just want to know then what is the need of 2 with the same limits....

Member Avatar for ~s.o.s~
0
108
Member Avatar for Thinka

Hello again people, I've got some questions about timing that I hope can be answered by someone. I'm trying to use the functions [I]getrusage[/I] or [I]times[/I], or the [I]time[/I] command to time my programs. Now I've got this piece of code that uses getrusage, and my first question is a …

Member Avatar for Narue
0
1K
Member Avatar for shanthu123

i have to find two time stamps one at the begining of main and at the end of main and take the difference to find the time elapsed to execute the code in between.Can anybody suggest the programs or proper API s in Linux.

Member Avatar for thekashyap
0
163
Member Avatar for math_man

[INLINECODE]#include<stdio.h> void print_message(void); void print_message(void) { printf("This is a bug\n"); } int main() { print_message(); }[/INLINECODE] I'm using VS 2005 SP1+SP for Vista on Vista buisness and as I wrote in Title when I have functions in my programs and I start debugging F10..F11, and debugger encounter a function instead …

Member Avatar for thekashyap
0
136
Member Avatar for laugh

hi.. i need help with this program. this is a program to turn 'ON' and 'OFF' 1 LED using 2 push buttons. the underline statement suppose to wait for button press. but it is alway false even i have press the button. is there any one who can tell me …

Member Avatar for Salem
0
103
Member Avatar for laugh

Hi.. I'm new in programming microcontroller in c. And I was given an assignment to write a simple program to turn 'ON' and "OFF' the LED by pressing push buttons. The microcontroller i'm using is PIC18F4620. And i'll need 1 LED and 2 push buttons to program this. I have …

Member Avatar for Salem
0
121
Member Avatar for himanjim

Hi, I've just started data structures....I'm studying Breadth first search and depth first search algo....Though I got some idea about them but after spending hours I can't understand the exact difference between them Which one is better ?? Please help me out

Member Avatar for thekashyap
0
165
Member Avatar for bklstheman

I am starting out, trying to learn come C programming over the summer (I've had experience in Java for over a year) and I got a problem when I use my compiler. I am using Dev-C++ and everytime I run my program it quickly closes. Now I know I can …

Member Avatar for iamthwee
0
119
Member Avatar for jlb_2_99

Is there any other code written for a coke machine program. We’ll start by having the user “insert” their money. Since they can’t physically insert the money, we will just ask them how much they wish to insert and we will keep track of how much money they have inserted. …

Member Avatar for Chaster
0
139
Member Avatar for nalinibh

Hi everybody, Can anyone among you let me know.how can i find execution time of an algorithm in my c coding!! thanks Nalini

Member Avatar for Ancient Dragon
0
110
Member Avatar for catch_ananya

Hi I would like to know if there is any certification in C available....like Sun certification for Java??

Member Avatar for ~s.o.s~
0
29
Member Avatar for matias.germany

Hi, I have a problem with the function [code]i=(abcdario[g]+h)%27;[/code], because i need to add this, but it gives me the error "invalid operands to binary +" The full code is the following [code] #include<stdio.h> //fopen() ,fclose() #include<stdlib.h> //malloc() int main (int argc, char*argv[]) { FILE *entrada, *salida; int caracter(unsigned char …

Member Avatar for Ancient Dragon
0
115
Member Avatar for MacLeopard

Greetings! I'm wondering if anyone has a kqueue outgoing socket example. What I mean is something that uses kqueue and connects to somewhere (in the example, let's say 1.2.3.4 on port 1234), and then polls the socket and when it gets data, calls the function receive_data(data), with data being the …

Member Avatar for unnameable
0
99
Member Avatar for yulin11

[red][b]Shell Sort[/b][/red] [code] void shellSort(int numbers[], int array_size) { int i, j, increment, temp; increment = 3; while (increment > 0) { for (i=0; i < array_size; i++) { j = i; temp = numbers[i]; while ((j >= increment) && (numbers[j-increment] > temp)) { numbers[j] = numbers[j - increment]; j …

Member Avatar for iamthwee
0
62
Member Avatar for stanats

i'm having this problem and i would like to ask for some ideas on how i will read a file backwards, that is, from end, read the file backwards(forward, naturally) by line.. thanks

Member Avatar for echobase
0
2K
Member Avatar for richie2021

[code] #include<stdio.h> #include<stdlib.h> int main() { struct { char origin[50]; char destination[50]; char flight[10]; char aircraft[3]; char days_of[7]; char departure[4]; char arrival[4]; char begin_date[10]; char end_date[10]; }flight_details[1679]; FILE *fp; fp=fopen("iaschedule-07(edit).csv","r"); char buf[50]; int i; while( fgets(buf,sizeof(buf),fp) != NULL) { strcpy(flight_details[i].origin, strtok(NULL,",")); strcpy(flight_details[i].destination, strtok(NULL,",")); strcpy(flight_details[i].flight, strtok(NULL,",")); strcpy(flight_details[i].aircraft, strtok(NULL,",")); strcpy(flight_details[i].days_of, strtok(NULL,",")); strcpy(flight_details[i].departure, …

Member Avatar for richie2021
0
122
Member Avatar for sweetleaf

well can any one help me with the internal representation of float and doubles ......i know tht they are stored using the IEEE 754 format so is that the reason why a double 0.7 is greater than a float 0.7 ?????

Member Avatar for sweetleaf
0
89
Member Avatar for nalinibh

Dear All, Many thanks for the answer of my first question though i had the answer for this from one who has already put this question forward.I have modified it and it has worked.Thanks!! Now i want to optimize my coding by adding another condition so that it doesn't perform …

Member Avatar for nalinibh
0
109
Member Avatar for jlb_2_99

I am trying to write a code that asks for the user first and last name and concatenate the function displaying the user's lastname and then firstname example: bob allen // first and then last name allen, bob // last and then first name using the concatenate function: This is …

Member Avatar for John A
0
125
Member Avatar for Elfshadow

Is this the right way to use fgets when its for non file input. [code=C] #include<stdio.h> int main() { char userinput[256]; printf("Enter a string:"); fgets(userinput,256,stdin); printf("%s",userinput); return 0; } [/code]

Member Avatar for WaltP
0
112
Member Avatar for Micko

Hello guys, It's been a while since I last time posted in this forum. I have strange problem regarding matrix allocation. I was asked to write code that includes 2D array dynamic allocation. I write two version of matrix allocation. Here is in my opinio relevant part of the code: …

Member Avatar for Micko
0
151
Member Avatar for mnmustafa

Hiz well i m new in here n i m goin to have exam after 3 days :S i got stuckd in a question Q) Write a program to print the product of even numbers..... plz i m new with c langauge :S n i m having final exam jst …

Member Avatar for sweetleaf
0
131
Member Avatar for Jishnu

Hi every=one, This is in continuation to my last post. Eve after initialising the 2d pointer a, as suggested, the same probllem as described earlier persists. Plz help -Jishnu. Hello, The code below calculates the determinant of the matrix. I know that the method of global 2-d pointers is a …

Member Avatar for Ancient Dragon
0
93
Member Avatar for aznstyles408

I wrote this function to generate random numbers and return it to the calling function [code=c] int getCard(void) { int range; int card; srand(time(NULL)); range = (10 - 1) + 1; card = rand() % range + 1; return card; } the calling function is.... int first2(void) { int firstCard; …

Member Avatar for Aia
0
165
Member Avatar for EnderX

I've been attempting to teach myself some C, as I have been tasked with maintaining a program written for a handheld barcode scanner that appears to be written in this language. (At least, I'm assuming that for the moment, considering the fact one of the first statements I saw when …

Member Avatar for Aia
0
152
Member Avatar for Jishnu

Hello, The code below calculates the determinant of the matrix. I know that the method of global 2-d pointers is a poor programming practice (so u don't need to reply saying that!!!), but it is a simple method for an amateur programmer. As the code didn't work, I set two …

Member Avatar for Salem
0
68
Member Avatar for pretu

Hi All How can we plot the pixel without using the function putpixel(int x,int y,int color) .

Member Avatar for Salem
0
358

The End.