19,876 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
185
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 ota1it1iuss

Iam new to programing, so be gentle!!!! I have to program the Fibonacci Sequence up tothe first 29 numbers. The output starts at 1 2 3 5, not 0 1 1 2. What am I doing wrong to not get the 0 1 output. Here is the code: [code=c++\] #include …

Member Avatar for shabnamapi
0
424
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
55
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
137
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
252
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
213
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
328
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
72
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
99
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
95
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
167
Member Avatar for Lusiphur

G'day all... I know there's a sticky in this forum for books that are recommended as C++ references from newbies to advanced coders. What I'm wondering is this... What are the online resources you [B]most[/B] recommend for C++ coders? What I'm looking for are those resources that are so useful …

Member Avatar for mike_2000_17
0
372
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
131
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
105
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
214
Member Avatar for rajina
Member Avatar for Nick Evan
0
71
Member Avatar for chaingang

set operation using array in c without using library function

0
27
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
150
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
130
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
98
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
103
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
88
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
814
Member Avatar for akilank

Hi.. somebody help me to implement c++ in Wifi development.. you will thankful..

Member Avatar for Kanoisa
0
242
Member Avatar for yuvaraj.ragupat

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

0
52
Member Avatar for drugoholic

Hello, First of all, I would like to say that I'm a newbie in visual studio. I come from a php/mysql background involved in web development. My task here is to create an real estate application for my company. I have so many questions but first I would like to …

Member Avatar for Geekitygeek
0
105
Member Avatar for zack_falcon

I'm a newbie C# programmer, and I would like to ask for help on this error. I was trying to get a button to change its image when it is clicked, a task that sounds so simple, I know, but whenever I run the program and click said button, it …

Member Avatar for Geekitygeek
0
211
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
97
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
120
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
462
Member Avatar for sabalksj
Member Avatar for shankarz
Member Avatar for ZlapX

Hello forum, this is my first post and I am sorry it must start out with a nooby question, but to become good you have to start as noob so... Ok, this is what i need help with: Basically im coding my first c++ console program for a job, my …

Member Avatar for ZlapX
-1
143
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
306
Member Avatar for yatender123

I have made a library management software in c++ i need some color codes and graphics to make it attractive can anyone help me

Member Avatar for Ancient Dragon
-1
37
Member Avatar for Coffee198

I am having trouble with my homework problem is: float total = 200; int - 1; for (i=1; i,=5;i++) { total=total/2 } print total: need output and flow chart Any help please?

Member Avatar for griswolf
0
113
Member Avatar for War_Archer

I wrote a code with fork() but I keep on getting the problem undefined reference to fork(). I know my code works 100% because I run it on my school computer and it works. How do I fix this problem? I use code blocks IDE with GCC compiler and GDB …

Member Avatar for War_Archer
0
2K
Member Avatar for Dendei

hey guys, emm can someone explain fast for me how to get to the programming state where u get a window with some options on the side and can then switch to code i cant remeber how to get there :) hope u understand thx for answers :)

Member Avatar for n.sehrawqat1987
0
94
Member Avatar for nosson

I'm having trouble dividing two elements of an array.... it seems to work in some instances, but not right now... I have two matrices[row][col] sized and am trying to transpose the elements to a matrix to a vector/array. That all works fine... but when I then try to divide the …

Member Avatar for WaltP
0
171
Member Avatar for al3x748769

i am new to C and i am trying to learn more as i am taking a basic class. we started out with basic programs and now we are making a tic tac toe board. i was wondering what a 8 bit binary counter would look like. i know the …

Member Avatar for viwenka
0
148
Member Avatar for dapcigar

Description of tasks: You are required to write a program that will calculate the total marks and the grade the student obtained on a multiple choice test paper. There are 20 questions and each question has an option A,B,C and D. Total of 30 students took the test. The correct …

Member Avatar for Adak
0
335
Member Avatar for Resnymph

Hello, I am trying to write a GUI in Visual C# which controls a C++ DLL, specifically getting hold of C++ objects and editing them via the C# propertygrid controls. - The first part of the question is 'is this actually possible'? I know I can use wrapper functions to …

0
220
Member Avatar for shirmaster

This is my code and i do understand the logic but i don't understand the algorithm. About the Parking time coz when i give 1:26 in the time in and 2:20 in time out, i got a negative parking time. here's my code [CODE]#include<stdio.h> void menu(char a); void getData(int *a, …

Member Avatar for kings_mitra
0
155
Member Avatar for gidireich

Hi All, I have experience with c, and familiarity with c++ & java (took courses on them, never really used) I want to learn c# now. I know c# is similar to Java. Time passed since my Java studies, so I guess I'll get the concepts fairly quickly, but I …

Member Avatar for Zinderin
0
165
Member Avatar for rampraveen

#include "stdio.h" #include "conio.h" #include "graphics.h" char far *vidmem=0xB8000000; main() { int gm,gd=DETECT; int r,c,i; char message[]="praveen"; initgraph(&gd,&gm,""); clrscr(); for(r=5;r<=20;r++) { for(c=5;c<=50;c++) write2vdu('',64,r,c); } c=10; for(i=0;i<=10;i++) { write2vdu(message[i],77,10,c); c++; } getch(); } write2vdu(char ch,char attr,int row,int col) { char far *v; v=vidmem+row*160+col*2; *v=ch; v++; *v=attr; } when i run this …

Member Avatar for Adak
0
146
Member Avatar for dy/dx

hi. we have this project, and we have to open a file where we will get what we need to evaluate. The problem is I can't move on to my project because the eclipse (using mingw compiler) can't build my source code. Here's my source code: [CODE]#include<stdio.h> #include<ctype.h> #include<stdlib.h> #include<string.h> …

Member Avatar for kings_mitra
0
184
Member Avatar for csmgsarma

Hi all, Here is a code snippet that is bugging me off for a while: [CODE] #define size (20 * 1024) unsigned char data_base[size]; /*my application here*/ ......... ......... ......... ......... [/CODE] The global variable "data_base" as you can see is uninitialized. The executable size was 434KB. when this variable …

Member Avatar for gerard4143
0
1K
Member Avatar for MxDev

Hi guys, Does anyone here know where I can get C# class library documentation, I've search the interenet but I couldn't get what I need. Any help appreciated. Thanks in advance.

Member Avatar for Teme64
0
175

The End.