-
Created printing char*
Is this the correct way to print char*? *I know c has the value I want because of the print statement below it. The o is not giving the value … -
Created Need ideas for dealing with strings of arrays
I need some ideas for dealing with array of strings. **ptr** contains my array of strings. The goal here is to combine certain strings when the conditions of the for … -
Created division help
I'm not getting the expected result when I do division. Can someone please tell me what I'm doing wrong? int page_list_size = 20; int page_fault_counter = 0; double failure = … -
Created infix to postfix math
After you have the appropriate infix to postfix expression how would you do the math with the expression? I'm having difficulty programming it. // Operator supported: +,-,*,/,%,^,(,) // Operands supported: … -
Replied To a Post in warning: passing argument 1 of 'strcat' from incompatible pointer type [ena
Can someone fix my title? I don't see an edit option. warning: passing argument 1 of 'cat' from incompatible pointer type [enabled by default] -
Created warning: passing argument 1 of 'strcat' from incompatible pointer type [ena
I'm having trouble getting the parameters correct in my cat function. I would think since I'm changing temp that I would need to pass the address since I want to … -
Created return the address from a function
What are some good reasons for returning an address from a function? -
Created algorithm help
I am trying to do Shortest Remaining Time scheduling algorithms turnaround time. This is the formula. Turnaround Time = Completion Time - Arrival Time I have already sorted my arrays. … -
Created break one level of nested loops
Yes I know the code is not complete. I know it will cause an infinite loop. The question is how would I break out of the first for loop and … -
Created strlen in for loop
BESIDES having to do a bunch of unnecessary iterations in a for loop with strlen doesn't it also produce weird behaviors? http://www.cprogramming.com/tips/tip/dont-use-strlen-in-a-loop-condition The documentation uses size_t instead of int. I … -
Created printf not behaving as expected
I have this print statement. printf("(n * o ) % m == 0 is invalid so exiting. \n"); And this is the output. (n * o ) Success == 0 … -
Created warning: passing argument 2 of ‘type_specifier’ from incompatible poin
Can someone please explain these errors? I don't have a multidimensional array so I don't understand how I'm getting this error. main.c:291: warning: passing argument 2 of ‘type_specifier’ from incompatible … -
Replied To a Post in passing the address of an array of strings to a function
@deceptikon I'm using C not C++ :(. -
Created infinite recursion
I'm getting infinite recursion here. I'm sorry if this is obvious but I don't see what I'm doing wrong here. program() gets called from main, then program() calls declaration_list(), then … -
Created passing the address of an array of strings to a function
I am trying to pass the address of strings_line_tokens to split_string. I would think I would need the "&" for the address then one of these methods would work. static … -
Created C compile error Variable-sized object may not be initialized with char * pt
Yes I did read these two posts. http://stackoverflow.com/questions/3082914/c-compile-error-variable-sized-object-may-not-be-initialized http://stackoverflow.com/questions/14186879/c-error-variable-sized-object-may-not-be-initialized My case is a bit different because I'm using `char * ptr[buflen]`. This is what I have tried: char *ptr[buflen] = … -
Replied To a Post in Atoi help
That makes sense :). Thank you. -
Replied To a Post in check if a number is between two values
Yes. Are you saying my cast didn't work? That is why I casted it. -
Created check if a number is between two values
Is the ordering of checking if a number is between two values important? I figured this would be pretty simple to do but its not working. if(0 <= (int)strings[p][0] && … -
Created Atoi help
If you carefully look at this example you will see with atoi when it runs into a string it gives the integer value of 0. So I was wondering how … -
Replied To a Post in If statement being ignored
I like it when you ask it that way :). When I have a 10 or 0. I figured I mixed up the logic and changed the **or** to an … -
Created If statement being ignored
I'm having trouble with the if statement. I have verified with print statements that (int)strings_line_tokens[l][m] == 0. I thought maybe my logic was backwards since I had two not statements … -
Created split string at different types of characters into separate strings
Is there a way to split a string at different types of characters into separate strings? char str[] ="(I) 44like22 .cookies. ,This, /is\ ?tricky?"; Something like this? ( I ) … -
Created Read file then do something something based on character
I need to read a file that is completely random and do something based on whatever character I get. I can get any of these character types "/", "*", a … -
Created Reading file error messages
I have seen both ways for reading file error messages. Is one better than the other? Is exit(0) better than return 1 or vice versa? FILE *fp; fp = fopen(argv[1], … -
Replied To a Post in Strange program compiles
This is the version info. gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) It looks quite old. https://www.gnu.org/software/gcc/releases.html How do I check if its c89 or c90? -
Created Strange program compiles
This program goes against everything I have been taught and learned in C. How does this compile? Why does this not need to be int main? Why no return 0? … -
Replied To a Post in JCheckBox vs JCheckBoxMenuItem
Your right :(. Keyboard shortcuts don't work the way you would expect. This method won't work. red1.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_X, ActionEvent.ALT_MASK)); You would have to use this method of keyboard shortcuts. leftJustify.setAccelerator(KeyStroke.getKeyStroke('L', … -
Created methods of using ItemListener
I have seen these two methods of using ItemListener. I am curios which is better and why. What are the differences? ItemListener a; Choice ce = new Choice(); ce.addItemListener(a); ItemListener … -
Replied To a Post in JCheckBox vs JCheckBoxMenuItem
Will I get any weird errors with using JCheckBox in a menu? I have done that and it seems to be working. -
Created JCheckBox vs JCheckBoxMenuItem
I was looking at these two examples and I was curious what the difference is between JCheckBox and JCheckBoxMenuItem. http://www.macs.hw.ac.uk/cs/java-swing-guidebook/?name=JMenuBar&page=3 https://docs.oracle.com/javase/tutorial/displayCode.html?code=https://docs.oracle.com/javase/tutorial/uiswing/examples/components/CheckBoxDemoProject/src/components/CheckBoxDemo.java These pictures make it look they are the same … -
Replied To a Post in netbeans jmenu popup only sometimes works
Netbeans is picky about the order. When I moved this to the bottom of main it works as expected :). f.setVisible(true); -
Created netbeans jmenu popup only sometimes works
I am having issue with jmenu popup in netbeans. It only sometimes works. Sometimes I don't get a java popup at all. Sometimes my File and Edit options are completely … -
Created setting an array to -1
If you want to set an entire array to -1 is better to cycle through it with a for loop like this? for (int i = 0; i < 100; … -
Created array out of bounds
Why am I not getting a segmentation fault or at least weird results with this array out of bounds? I'm a bit disappointed. One of the few times I actually … -
Created c programming variable name rules
Where are the c programming variable name rules defined? I usually use these two websites for figuring out these kind of things but I don't see it anywhere. http://www.tutorialspoint.com/c_standard_library/c_function_scanf.htm http://www.cplusplus.com/reference/cstdio/scanf/ -
Replied To a Post in infintite loop while reading from pipe
Here is more code can anyone spot a problem? if(manager_pid == 0) { printf("Hello? \n"); if(close(pipe1[READING]) != 0) { printf("Error in closing pipe1 \n"); } if(close(pipe2[READING]) != 0) { printf("Error … -
Created infintite loop while reading from pipe
Can anyone tell me why I have an infinite loop when reading from a pipe? i = 0; while(i < 10) { test_value = read(pipe3[READING], &message, sizeof(struct MESSAGE)); printf("test_value is … -
Replied To a Post in fscanf vs fgets with sscanf
What happens in this case? It was able to deal with the **/n**. while (fscanf(init_dat_fp, "%s %d", nam, &val) !=EOF) { //sscanf(line1, "%s %s %x", label, mneumonic ,&start_address); init_name_table[counter] = … -
Replied To a Post in combing a while loop read with creating a pipe.
I would like the fork to execute, then I would like all the activities in the while loop to take place in that child process, Then I want to send … -
Created combing a while loop read with creating a pipe.
I have this if block that is supposed to be creating a pipe then forking and I would like to combine the while loop below it with it. How would … -
Created Using multiple pipes
Is this a good example of using multiple pipes. I need to fork 3 children. Would I just need to repeat the process in between the hyphens? Where would I … -
Created fscanf vs fgets with sscanf
I started off reading a file with fscanf. I figured I could use fscanf since the file was consistent with just two columns. I got very strange output when using … -
Created fopen w vs wb
I have used this several times in the past for writing to files. Is there a problem with this? I'm just writing text. I have never had any issues. What … -
Replied To a Post in C Programming Priority queue questions
Thank you for your patience in giving your very detailed explanation :). I changed the malloc part, added the initialization part, fixed the del() function. -
Replied To a Post in priority queue with double priority
I changed the malloc part, added the initialization part, fixed the del() function. My priority is coming from the calculation of a distance formula. As you know when calculating the … -
Created priority queue with double priority
I am using a priority queue with a double as the priority. I am guessing this is cause so issues. I used these numbers first with no issues. 34.365681 34.481879 … -
Created C Programming Priority queue questions
I was reading this example of Priority queues and have several questions. http://matrixsust.blogspot.com/2011/11/basic-priority-queue-in-c.html #include<stdio.h> #include<malloc.h> void insert(); void del(); void display(); //How exactly do structs in structs work? Do you … -
Replied To a Post in c programming casting struct values
Yes. I screwed up a comma in a pass to my function. Google wasn't giving me any useful results so I assumed it was a casting issue. I also couldn't … -
Created c programming casting struct values
I am trying to cast an int value in a struct to a double. I am guessing I am screwing up the parenthesis somehow. I wasn't able to find anything …
The End.