519 Posted Topics

Member Avatar for Alerwiali
Member Avatar for abhimanipal
0
81
Member Avatar for SanJuanWolf

@SanJuanWolf Who decided the number of groups ? @Adak Quick question. How do you plan to implement nested loops when the number of groups is a variable I have a dirty solution which may work in this scenario but I am hoping Adak can make that unnecessary

Member Avatar for Airshow
0
221
Member Avatar for 1bh

Hi I modified the above program some what ... I tested the program for /bin/ls and /bin/pwd and the program worked. The program makes some assumptions. I will leave them for you to clear out :) [CODE] int main() { char temp[256]; char *argv[100]; char *p; int i=0; int child; …

Member Avatar for abhimanipal
0
242
Member Avatar for mi.mac.rules

When you are reading from the file the value of MAX is 101. But each line has less than 101 characters . So what you want to do is something of this sort [CODE]int main() { FILE *fp = fopen("mytestfile.txt","r"); char arr[100]; // Open a file char *p; if(fp == …

Member Avatar for mi.mac.rules
0
2K
Member Avatar for BlakTasTic

atoi is used with string and not chars. [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/atoi/"]This[/URL] link explain the function along with some sample code just google for malloc/ calloc you will find tons of documentation and examples

Member Avatar for WaltP
0
103
Member Avatar for Emaneitron

Also why dont you guys write your code incrementally ? Then if you get a compiler error, it is quite easy to spot the reason

Member Avatar for abhimanipal
0
200
Member Avatar for titan_amit

Have you heard of a little known website called as google.... Try it out.... You might like it Here is what I found in just 0.23 seconds in this website [url]http://www.codeproject.com/KB/audio-video/madlldlib.aspx[/url]

Member Avatar for Inth
0
224
Member Avatar for bosdak

Use the code tag.. After you have pasted your code into the little box, select all the code and then click on the (CODE) Preview your post to see if the formatting has come out correctly or not

Member Avatar for justiceigwe
0
2K
Member Avatar for phil750

When you just type ls, your code is breaks out at line 79. Check the usage of strtok properly

Member Avatar for C++ThugLife
0
282
Member Avatar for freda173

Simplest solutions: Make the variable global . So you want to write some thing of this sort [CODE] char *p = NULL; void func() { p= "Value returned using global variables"; } int main(int argc, char *argv[]) { func(); printf("%s\n",p); return 0; }[/CODE] Or you can return a char array …

Member Avatar for freda173
0
160
Member Avatar for Katana24

Xcode hides lots of stuff from you. If your are going to be using C only for a couple of days then probably X code is the right way to go. But if you want to learn the language from ground up, then probably you want to explore the terminal …

Member Avatar for creeps
0
217
Member Avatar for Rahul.menon

Try solving the unsolved questions on this forums ... Or check out source forge ... Its full of exciting projects and they always need more contributors there

Member Avatar for gaurav_13191
0
93
Member Avatar for onus

What exactly is your problem ? As the way I see there are many issues with this program. That being said I appreciate the fact that you attempted to work on this problem instead of simply posting "give me the code" Here check out this [URL="http://cslibrary.stanford.edu/110/BinaryTrees.html"]link[/URL] It is very helpful …

Member Avatar for onus
0
253
Member Avatar for westony

[QUOTE=westony;1345286]aha :) thanks man :) i get it :) and last question... Do you think that this is the optimal way for linked list or ? Can you give some advice :)[/QUOTE] I dont think the code you have written is correct. What do you wan to do in the …

Member Avatar for abhimanipal
0
163
Member Avatar for abhi_elementx

Yes I know the thread is almost a year old but this seemed like an interesting questions and there was no follow up @winrawr I ran your code in a Windows machine and it worked. No seg fault no nothing

Member Avatar for abhimanipal
0
836
Member Avatar for amala.123

This seems like an interesting question so I will ad myself to this discussion @Banfa can you explain this concept with a bit of more detail ?

Member Avatar for amala.123
1
658
Member Avatar for gju

Just a small addition to the above post. When ever you declare arrays dynamically you must [CODE]int main() { int *arr =(int *)malloc(sizeof(int)*10); if(!arr){ // Check if you did get the memory you asked for printf("No memory. Terminating program\n"); exit(1); } else{ printf("Sufficient memory found\n"); } // Do operation on …

Member Avatar for abhimanipal
0
126
Member Avatar for ItecKid

I am not so sure if that was the only reason for your problem . Try running this piece of code [CODE]int main() { char *arr = "ls -l"; char *pch = NULL; printf("%s\n",arr); pch = strtok(arr," "); printf("%s\n",pch); return 0; } [/CODE] This will give you a seg fault. …

Member Avatar for abhimanipal
0
804
Member Avatar for tomtetlaw

Well I dont think strtok will give you that What you can do is something like this Use strtok to find the next token Use strlen to find the length of this token. Let this be l1 Now your string of interest is from l1 to end of the original …

Member Avatar for Narue
0
173
Member Avatar for MKDWOLF

Bus error is usually because you have tried to access some memory that does not belong to you - You have int arr[10] and you try to access the arr[10] Your best bet is to use printf's to try to narrow down the problem

Member Avatar for abhimanipal
0
98
Member Avatar for itsmeisuru

Why do you want to open the num file when both the number and name are present in the numAndName file ?

Member Avatar for N1GHTS
0
108
Member Avatar for gudads

@gudads If this is your first program I suggest you ditch X-Code and work on the terminal

Member Avatar for knobcreekman
0
284
Member Avatar for durpderp

I can help you a little bit. My changes are in red [QUOTE=zark_yoc;1329970]show you simple example of pipe [code=c] #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <wait.h> int main() { pid_t pid; int pipe_fd[2]; if ( pipe(pipe_fd) == -1 ) { perror("Pipe create error"); exit(1); } if ( …

Member Avatar for durpderp
0
166
Member Avatar for Jishnu

This is my O/P on a mac machine ~$ ./test initial file handle :: 0 child read :: abcdefghij child file handle :: 11 parent file handle :: 28 parent read :: end file handle :: 28 ~$ Maybe some one could shed some more light on this matter

Member Avatar for Jishnu
1
594
Member Avatar for gudads
Member Avatar for bnickerson

Are you having a problem only with image data or even with simple data as well ? The RST flag is usually raised when a host receives a packet which does not belong to the current connection.

Member Avatar for abhimanipal
0
985
Member Avatar for Mouche

Have you worked with a linked list ? I think all of your functions are some of the most basic operations on a linked list

Member Avatar for abhimanipal
0
151
Member Avatar for sakthi@daniweb

1. Remove the dependency on conio.h 2. void main should be int main 3. No need for getch()/ clrscr 4. Get rid of scanf

Member Avatar for abhimanipal
0
249
Member Avatar for reliableravi

[QUOTE=sakthi@daniweb;1330069]you can use turing machine concept than finite machines to this..[/QUOTE] What exactly do you mean ?

Member Avatar for abhimanipal
0
251
Member Avatar for bnickerson

Check out [URL="http://www.tenouk.com/Module40c.html"]this[/URL]. This already has some sample code with it [URL="http://en.wikipedia.org/wiki/Berkeley_sockets"]this[/URL] for a more conceptual explanation

Member Avatar for bnickerson
0
2K
Member Avatar for SHENGTON

I am sorry can you explain a bit more .... What is the exact problem that you are facing ? This is the O/P that I got after running your code $ ./test [1] Stack [2] Queue [3] Exit Enter your choice: 1 [1] Push an item [2] Pop an …

Member Avatar for abhimanipal
0
298
Member Avatar for Danny_501

If you are planning for multi threading then why not let a thread wait for user input ?

Member Avatar for sree_ec
0
254
Member Avatar for amit kithana
Member Avatar for sree_ec
-1
162
Member Avatar for sankhamita

Also the OP wants to know the names of the header files not the count ..... If the objective of OP is to prevent including the same header file many times then check out [URL="http://bytes.com/topic/c/answers/892067-header-files-problem-recursive-includes"]this link[/URL]

Member Avatar for Adak
0
118
Member Avatar for poulami510

[url]http://www.google.com/search?q=c+program+bisection+method&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a[/url] Next time run a google search for your question before posting it here

Member Avatar for prvnkmr449
0
116
Member Avatar for atomic33

Also even if you have a very basic knowledge of C and math, calculating the average should be easy

Member Avatar for Ancient Dragon
-2
113
Member Avatar for SHENGTON

If you are interested in fixing your code I would start of by getting rid of the list data structure ... It just adds complexity

Member Avatar for abhimanipal
0
113
Member Avatar for rcjay2

You have declared the name as a float variable. Change it to a char array Also the correct way to accept a string via scanf statement is scanf("%s",input); PS: Using scanf to take user i/p is a bad idea. It usually leads to a wide varieties of problems. Use fgets …

Member Avatar for abhimanipal
0
180
Member Avatar for aminit

Well to start with try to convert an integer to string . While there are inbuilt functions you can use for this I would encourage you write your own. It will be a good experience if you are new to programming Post your doubts/ questions here

Member Avatar for abhimanipal
0
77
Member Avatar for bharat47
Member Avatar for Mst8kenId

Can you describe the problem in more detail ? Simple saying that the O/P is wrong is not sufficient . put some printf's in your code and see how the control is flowing Of the top of my head I see you have used the pointer *tmp but there is …

Member Avatar for abhimanipal
-1
80
Member Avatar for Tlhoks

Also the return type of your printDetails() function is int but you are not returning anything from that function. Either make the return type of that function void of return an int value from that function

Member Avatar for abhimanipal
0
92
Member Avatar for Anil2447
Member Avatar for frodo_man

In the simulator of iPhone you cannot use most of the hardware features like accelerometer, location, camera,etc Besides this the timing and performance results that you get out of a simulator will be very different from that of a real device. So if you want to develop apps for iPhone …

Member Avatar for Master Rattley
0
102
Member Avatar for gahhon

Run the code despite the warning . What O/P did you get ? I ran this code [CODE]int main() { int x=5; switch(x >0) { case 1: printf("In case 1\n"); break; case 0: printf("In case 0\n"); break; } return 0; }[/CODE] and this was my O/P $ ./test In case …

Member Avatar for Adak
0
178
Member Avatar for tots08

Quick question ... When you open a file why dont you check if the file has actually been opened or not ?

Member Avatar for tots08
0
264
Member Avatar for ellenski

How about giving us some idea of which part of the code is not working ... You know some thing of the sort this should be the expected O/P and this is what I am getting ......

Member Avatar for abhimanipal
0
165
Member Avatar for rajsekhar28

To further develop AD's point [CODE] void func1(int** p) { int x=20; *p= &x; printf("In pointer to pointer to int\n"); } void func(int* p) { int x=20; p= &x; printf("In pointer to int\n"); } int main() { int x=10; int* p= &x; func(p); printf("Value of x now is %d\n",*p); func1(&p); …

Member Avatar for Ancient Dragon
0
126
Member Avatar for daredevil786

There are a couple of things If you have [CODE] int x=[1,2,3,4,5]; printf("%u\n",x); // Address of the first element of the arry printf("%d\n",*x); // Value of the element at the address x ie the first element of the array [/CODE] So if you write the statement [CODE]y = ptr - …

Member Avatar for pheininger
0
1K
Member Avatar for patrick k

I ran your code and I got the correct o/p ie 10,4743 Where are you running your code ? Is it a specialized device ? One thing you could do is dont jump straight to 10,000 Go there exponentially you know first calculate the 2,4,8,16,32,64 and so on

Member Avatar for GreenDay2001
0
129

The End.