15,552 Topics

Member Avatar for
Member Avatar for mike.bauer

How do I rewrite eq->pt_tree[0][0]=2; to user pointer subscript? [CODE]#include <stdio.h> #include <stdlib.h> /////////////////////////////// struct eq_values{ int * pt_tree[2]; }; //////////////////////////////// void main (){ struct eq_values input, *eq; int i =2; eq = &input; while(i--){ eq->pt_tree[i] = (int *) malloc(3 * sizeof (int)); if (!eq->pt_tree[i]){ printf("No\n"); exit(0); } } eq->pt_tree[0][0]=2; …

Member Avatar for deceptikon
0
107
Member Avatar for mike.bauer

I have the following struct deceleration and I would like to decrement eq->pt_tree[c][r], the row portion of pt_tree[c][r] using pointer subscript. How can I do this? [CODE]struct eq_values{ int * pt_tree[2]; }; eq->pt_tree[i] = (int *) malloc(12 * sizeof (int)); [/CODE] I think it will look like the following, but …

Member Avatar for deceptikon
0
142
Member Avatar for flagstone

I am trying to implement a chat program using epoll on the server side. However, the program gets stuck at epoll_wait(). How should I create an asynchronous chat program? [CODE] #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <sys/socket.h> #include <netinet/in.h> #include <sys/epoll.h> #include <fcntl.h> #include <netdb.h> #include <unistd.h> …

0
236
Member Avatar for Gaiety

Hi , what is the behaviour of below pseudo code. [CODE] pipe(fd) if(fork()){ read(fd[0]); } else { write(fd[1]); write(fd[1]); } [/CODE] I understand how system calls work , but could not understand the behaviour when used differently. secondly if a process uses while(1); in side its block, will the entire …

Member Avatar for Gaiety
0
186
Member Avatar for shanki himanshu

i am using 'atof' function to convert string into double but it shows the correct value if the string length is 17(max). is ther any function if string length is more than 17?

Member Avatar for DeanMSands3
0
147
Member Avatar for xavier666

I've tried to make a [URL="http://en.wikipedia.org/wiki/Deque"]DEQUE[/URL] program. My book on data structures (Seymour Lipschutz) doesn't have an algorithm on DEQUES. Neither does [URL="http://www.itl.nist.gov/div897/sqg/dads/HTML/deque.html"]DADS[/URL] give a good description. All I heard was that it could be implemented better with two lists (one forward and one backward) & there are 2 types …

Member Avatar for WaltP
0
258
Member Avatar for ohblahitsme

Hi everyone, I'm trying to figure out how I can write information stored in a variable to a file (right now I have a text file, but that's probably not the best way to do it) and then be able to recall that information back to the variable after I …

Member Avatar for WaltP
0
98
Member Avatar for dos_killer

im trying to make my own kernel.... my kernel is loaded through grub... i tried creating the gdt and idt for myself... i dont know how to test the gdt and as far as the idt is concerned it failed to capture the division by zero error ... source code …

Member Avatar for dos_killer
0
180
Member Avatar for infantheartlyje

Hi folks, I'm having a doubt. I write a letter in notepad and i saved it as 'letter.txt'. Then i realized that i forgot to say one matter in that letter. So i opened 'letter.txt' using any text editor such as notepad, wordpad or something. Now i inserted the letters …

Member Avatar for deceptikon
0
235
Member Avatar for fsemilla

good day to all... does anyone here have a basic tutorial on how to program using C for zigbee...? its just that i have a very important project task in my work which should be accomplished for three months:'( ...i do have basic...i mean enough knowledge programming in C but …

Member Avatar for agieli
1
2K
Member Avatar for Joniniko

Alright so basically i need to create a simple maths game in C. Involving addition subtraction and multiplication of random numbers. But i also need to add a timer to that. So lets say you are given 10 seconds to answer the question and every correct answer adds you 10 …

Member Avatar for JilMakias
0
450
Member Avatar for passionated

#include <stdio.h> int main() { int num, i = 1; printf("\n Enter any Number:"); scanf("%d", &num); printf("Multiplication table of %d: \n", num); while (i <= 10) { printf("\n %d x %d = %d", num, i, num * i); i++; } return 0; } Hi.. Can someone please patiently explain me …

Member Avatar for JilMakias
0
182
Member Avatar for SergioQ

Am not looking for a specific deleted file. Let me put it another way, and maybe someone can help me in another way.... Am looking for lost info. Files lopng deleted etc. But since this machine has bearely been used, it's posssible the data is sitting in an a now …

Member Avatar for YourGamerMom
0
97
Member Avatar for JilMakias

How can i send a file at my e-mail address? I want to write it in my C program. Is there any simple way to do that? I Use Dev C++ compiler. I am not using C# or VB. Thanks in advance for answering.

Member Avatar for DeanMSands3
0
6K
Member Avatar for vic s

hi, my name is vic...i got one problem cannot fix....output for the number of times each of the tasks has been invoked...i run 3 times each of the tasks but the output always is this program has run 1 times..... #include<stdio.h> #include<stdlib.h> void doTaskA(){ printf("Start of Task A\n\n"); int input_1, …

Member Avatar for DeanMSands3
0
230
Member Avatar for badboy11

Looking for an equivalent container class that matches to C#'s Arraylist collections class. Is there anything that comes close to a container that can provide index based enumeration as well as hold multiple data types. I am trying to create an vector that can hold multiple data types. For example: …

Member Avatar for badboy11
0
992
Member Avatar for drewangel

hi all, i need to know how to create a thread using pthread_create()? i have never used pthread in c. am i supposed to used function pointer? how to pass arguments in thread function? i need to know everything about pthread_create(). and yes i am using turbo c++ compiler and …

Member Avatar for DeanMSands3
0
726
Member Avatar for badboy11

Need help with implementing a pure abstract class via inheritance, using namespace to wrap all my classes to avoid conflict with others. I have been able to build and run the code successfully if I remove namespace wrapper from my abstract class and all classes that inherit from my pure …

Member Avatar for badboy11
0
253
Member Avatar for jatinkhandelwal

if would like to print the size of data type entered by user. how can i do so (without using case and if) is it possible to store the data type in a string and print the size of data type in that string???

Member Avatar for Ancient Dragon
0
122
Member Avatar for modesto916

Hi everybody, I am learning C at the University, and I want to study by myself to avoid difficulties there, I am doing some exercises from a pdf that I got, and it asks me to write a program to invert a string using only what was explained in the …

Member Avatar for modesto916
0
162
Member Avatar for Ich bin würdig

Hi guys ! I've made a program that marks a seat taken X in an airplane .. So, here's what I've done.. it runs , but when i try to input other seat code, i.e., 1G, the no.2 in the grid becomes 88.. and I don't know how did that …

Member Avatar for zeroliken
0
116
Member Avatar for shanki himanshu

cant we compare two for inequality? i mean if i have a char array 'a' and i want to know the number of digits in an array which is not '4' or not '7' i.e if my array has value 4567778 the output should be 3 as there are three …

Member Avatar for DJSAN10
0
74
Member Avatar for gynmd

i'm studying file processing. when i execute the second code that Reading Data from a Sequential Access File something goes wrong with it. i couldn't find what is wrong. is there anyone who can help me? [CODE] /*creating a sequential file*/ #include<stdio.h> int main() { int account; char name [30]; …

Member Avatar for nairulhadri
0
225
Member Avatar for nairulhadri

When i try to input this data: 11 jack 90 22 mike 99 the result will be on the attachment. [CODE]/*Create a sequential file*/ /*"w" is a made for creating a file for writing*/ /*if the file already exists, it will discard the current contents*/ /*%s stands for string is …

Member Avatar for WaltP
0
221
Member Avatar for sagarnarasgonde
Member Avatar for student_learner

suppose that i write a program in turbo c: Q1.) the operating system program is in RAM.(yes or no?) Q2.) the turbo c application is in RAM. (yes or no?) suppose that i have written this simple code: [code] #include <stdio.h> #include<conio.h> void main() { clrscr(); int a=2,b=3,c; c=a+b*3; printf("%d",c); …

Member Avatar for rubberman
0
330
Member Avatar for Candace Parker

Good day, people! I have here a code in C that needs improvement. It should list all the permutations of ABCDEF where C and E should be beside each other in any order (CE and EC). I know that I must treat C and E as one so I used …

Member Avatar for WaltP
0
3K
Member Avatar for programmerb

please someone help me in printing 2 outputs in c using for or while loops . i am a begineer and i need help fast please. 1st pattern : 0 111 22222 3333333 444444444 55555555555 upto 10 . 2nd pattern: ABCD EFGH IJKL MNOP QRST UVWX YZ PLEASE HELPP

Member Avatar for inspire_all
0
114
Member Avatar for Matkoo

Hello, guys. I made a program to compare numbers, Example input: [QUOTE] 1 3 10 845157 2 1101101 16 5AE12 [/QUOTE] It transfers numbers from different number system to decimal, then it compares them, but it is not so fast as i need, maybe just a little advice needed, I …

0
173
Member Avatar for srinath1

inr main () { int x=3,y=4,z=4; printf("%d",z>=y>=x), } the answer is zero ..how??

Member Avatar for sharathg.satya
0
177

The End.