15,550 Topics

Member Avatar for
Member Avatar for evinkeating

I'm working on a C program that needs a lot of dynamic memory allocation of 1-D and 2-D arrays. The program works fine when I compile and run it using windows and Visual C++, but when I compile and run it in a Unix environment, I get slightly different results, …

Member Avatar for Ancient Dragon
0
182
Member Avatar for firoz3321

Sir, i'm new here searched the forums and web. I'm a beginner and dont know C very well. The Question actually is this: [QUOTE]Write a C function called DistinctWords that counts the distinct words in its input string and prints them in the descending order of number of its occurrence. …

Member Avatar for Adak
0
3K
Member Avatar for M4RUF

I've got to write an application in C which can take an input file containing RISC instructions and then output to screen the encoded version of these instructions. I will be working with the following op-classes: 0 1A 2A 2B 2C 3A 3B 3C 3D I already have the code …

0
52
Member Avatar for vijaysrivatsa

Do the following for the user-entered number of students. Find the average marks for a student of his marks in 3 subjects. Print whether he passed or failed. A student will fail if his average is less than 50. Use for loop...can u help me writing this pgm.....thankss:-/

Member Avatar for Adak
0
132
Member Avatar for arsenal_fan

Hi, this is not a homework or assignment. I am preparing for interviews. I just wanted to know how do I find out say the next 6 byte aligned address given any random address? Hope I am clear. Any code or explanation will be appreciated. Thanks.

Member Avatar for arsenal_fan
0
232
Member Avatar for pawan_sharma777

5. Write a program to automatically generate the telephone numbers. The requirements are as follows: Declare a character array to hold a 7-digit telephone number •Accept the telephone number as a string. The first four digits is the department code and the last three digits is the telephone number. (Example: …

Member Avatar for Ancient Dragon
0
190
Member Avatar for SHENGTON

Hello, good day. :) I got a problem here in displaying the items of array. In "Display Items", it should display the numbers that I inputted in the "Input Items". Is there lacking in my code? [b]Menu:[/b] [IMG]http://i168.photobucket.com/albums/u162/SHENGTON/menu.png[/IMG] [b]Input Items:[/b] [IMG]http://i168.photobucket.com/albums/u162/SHENGTON/input.png[/IMG] [b]Display Items:[/b] [IMG]http://i168.photobucket.com/albums/u162/SHENGTON/result.png[/IMG] Here's the code: [CODE=C]#include<stdio.h> #include<conio.h> int …

Member Avatar for Ancient Dragon
0
282
Member Avatar for poornimashobana

hi This is Poornima.L any one can u help me how to convert double to int ???? int int_var=(int)double_var; wen i give the above stmt i get floating point error:abnormal termination in my console screen help me out

Member Avatar for poornimashobana
0
69
Member Avatar for pawan_sharma777

How to declare an array to store the different five(5) name and initialize the following char array with {"Lara","Lin","Nitin","Krishna","Sophia"}

Member Avatar for pawan_sharma777
0
94
Member Avatar for iqra123

hiiii, can anyone tell me about computational complexity of AES, DES and BLOWFISH techniques. i am using these techniques for a string. and calculating execution time of these thre techniques. and now want to know their complexity on the basis of execution time... plzzz Help me out! Regards!

Member Avatar for Adak
0
93
Member Avatar for adi.shoukat

I want to write a Code in C which can create copy any given file (txt, bmp, jpg, pdf etc) what i've written so far is: int main(){ FILE *fp; char ch; FILE *fpW; if((fpW = fopen("file2.gif","wb"))==NULL) { printf("Cannot open Destination file.\n"); exit(1); } if((fp = fopen("file.gif","rb"))==NULL) { printf("Cannot open …

Member Avatar for Adak
0
2K
Member Avatar for ice_cool

Hello all, I've had some java experience and looking at my uni units next semester, 1 involves using C, so I decided to start coding C :p. Is there anything wrong with the program structure below? I think there is also some code duplication in there also. [CODE]#include <stdio.h> /* …

Member Avatar for ice_cool
0
165
Member Avatar for Jeffrey0209

This is the code wrote so far.. I'm new to Cprograming. please help thank you! [CODE]#include <stdio.h> #include <stdlib.h> #include <conio.h> //Compute f(n)=n!, for 0<=n<=100 void f(int n){ // Adjust the array a so that each array element contains a single // digit without altering the number represented by the …

Member Avatar for Jeffrey0209
0
129
Member Avatar for sdinu96

why computer takes more execution time when a function is called ? i want theoritical explanation.............that is what happens internally.......... this is diadvantages of Function Why it takes more execution time ?

Member Avatar for abhimanipal
0
103
Member Avatar for stackOverflow

Hi everyone, I am using TC 3.0 . I'm getting an error as.. BGI error:graphics not initialized. But I've used initgraph. So, i thought i'll use this [CODE]/* read result of initialization */ errorcode = graphresult(); /* an error occurred */ if (errorcode != grOk) { printf("Graphics error: %s\n", grapherrormsg(errorcode)); …

Member Avatar for shahana.1988
0
205
Member Avatar for rajina
Member Avatar for Nick Evan
0
68
Member Avatar for chaingang

set operation using array in c without using library function

0
25
Member Avatar for d34dw4rd

here is my code of a linked list with a header file however it works in debugger mode but in normal run time it crashes Please help! Here's the header: [CODE]/* Lab3 Abstract Data Type - header file */ /* Type Definitions */ typedef struct { char state[20]; int year_adopted; …

Member Avatar for d34dw4rd
0
148
Member Avatar for johndoe444

[CODE]set_child_at (node=0x7fffffffe080, child=0x61e250, index=1) at 10679.c:319 319 if ((*node)->count_children == (*node)->m) (gdb) p *current_node $3 = (trie_node *) 0x0 (gdb) n 324 index = hash_insert((*node)->hv, index, (*node)->m, (*node)->m1); (gdb) n 325 (*node)->children[index] = child; (gdb) p current_node $4 = (trie_node **) 0x61e270 (gdb) p *current_node $5 = (trie_node *) 0x0 …

Member Avatar for gerard4143
0
104
Member Avatar for oldbamaguy

I define a variable as float num1; I try to use a scanf to read it scanf("%f", num1); I get some (what I think is a crazy response) statement expects a float, argument is a double I am sure I must be doing something wrong because I also get this …

Member Avatar for oieronle
0
95
Member Avatar for johndoe444

[CODE] set_element* make_set(int key) { set_element* node = (set_element*) malloc(sizeof(set_element)); node->parent = node; node->rank = 0; }[/CODE] In the above code there was no return statement and the function was used like this [CODE]elem1 = make_set(f1);[/CODE] And the code was working as expected. This is very funny. I am not …

Member Avatar for gusano79
0
102
Member Avatar for largedimples

What compiler can I use to build/run an flex scanner? I tried mircle and visual studio 2010 neither one would run the program. I have until mid night tomorrow to workout all the bugs and submit them. Thanks in advance

Member Avatar for gusano79
0
85
Member Avatar for Jamesbch

Hello everyone, I'm working on a program that reads a PNG and extracts a custom chunk from it (using libpng). But now I've got problems to actually register my callback function to handle unknown chunks. According to the official documentation I have to declare which chunk is "unknown" (by their …

Member Avatar for Jamesbch
0
789
Member Avatar for yuvaraj.ragupat

Hi all can anybody tried with mtd flash lock for spansion s29GL series ? Please guide me Thanks Yuvi

0
50
Member Avatar for potato4610

Using nested for loops, how do I write a program that asks the user to input an integral number and then displays a diagonal line with that many dots on the console screen starting in the column? An input of 4 would display four diagonal periods, while an input of …

Member Avatar for Liyaan
0
94
Member Avatar for dsrepublic

I'm currently doing MIT Opencourseware's Practical Programming in C. I'm finding pointers a little bit confusing. Here are some questions: 1) int *pa=arr Suppose char * pc = (char*)pa; what value of i satisfies (int *)(pc+i)== pa + 3? [Answer:i=12] I get that the address is 12 bits down because …

Member Avatar for Ancient Dragon
0
117
Member Avatar for ankush chander

/* * hello−1.c − The simplest kernel module. */ #include "/usr/src/linux-headers-2.6.31-16-generic/include/linux/module.h" /* Needed by all modules */ #include "/usr/src/linux-headers-2.6.31-16-generic/include/linux/kernel.h" /* Needed for KERN_INFO */ //#include "/usr/include/linux/module.h" //#include "/usr/include/linux/kernel.h" int init_module(void) { printk(KERN_INFO "Hello world 1.\n"); /* * A non 0 return means init_module failed; module can't be loaded. */ return …

Member Avatar for ankush chander
0
451
Member Avatar for sabalksj
Member Avatar for shankarz
Member Avatar for sourabhtripathi

[CODE] int a[10]={3,45,6,78,89,334,4,77,54,60}; int *p=a; [/CODE] what will *p++ do ? as ++ has more priority than * therefore ++ will be executed fisrt ? but its postincrement so it will happen after change of line or statement. so will it increment the pointer or increment the value hold by …

Member Avatar for jaaz....
0
304

The End.