128 Posted Topics
Can someone please explain why "#include <stdlib.h>" fixes "warning: implicit declaration of function". Also what does #include <stdlib.h> mean and when should you use it? | |
Could someone please tell me what these errors mean and how to fix them. [CODE]inputter.c: In function âget_next_tokenâ: inputter.c:21: warning: initialization makes integer from pointer without a cast inputter.c:17: warning: unused variable âcur_posâ[/CODE] [CODE]/* Get an RPN expression from the keyboard. * Accepts q as indictation that user wants to … | |
I'm going through my professors notes right now and he says in big bold print "Length does not include terminating null". I've looked at 2 different versions of this and in both cases it counts the terminating null. Can someone explain why this is happening. Case 1 [CODE]#include <stdio.h> #include … | |
Can someone please explain why this function will not compile. [CODE]#include <stdio.h> #include <string.h> #include <ctype.h> // This function determines if a string is a palindrome. /* This function reverses the characters in the string * passed by the caller. */ void is_palindrome (char* string) { int i; int length … | |
Here is a nice little swap function with a good explanation about what is going on. [url]http://computer.howstuffworks.com/c26.htm[/url] | |
| |
How do you get your recent vi command history to show up? I keep randomly getting like my previous 5 commands and can't figure out how I'm doing it. I think it has something to do with the shift key and another button. I know you can use the up … | |
I'm having difficulty breaking out of this nested loop. This is a function for reducing a fraction. Normally original_num and original_denom will be numbers that are reducible and z will normally be the GCD. Sometimes like in this particular that you see here 37 and 51 are not reducible. The … | |
I have a weird Buffer Clearing Error in this code. This is the line that is causing the error. [CODE] if(a<=0) [/CODE] After you compile the code and run the code put in a group of letters like abc when the programs asks you to put in an integer. The … | |
Does anyone know where there is any good documentation for input functions in C programming? I've been searching google for quite awhile with no luck :(. | |
How would I make all letters be an invalid input? I want all letters, numbers greater than 20, and numbers less than or equal to 0 to be invalid inputs. I used an or cause I want any case to be an invalid input. Any help would be greatly appreciated. … | |
When you have a function and need to scan for 2 different numbers, should the scanf be in the function or in the main() and why? | |
Could someone explain where and when you would use << and >>. I read these 2 articles but don't really understand them. [url]http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B[/url] [url]http://en.wikipedia.org/wiki/Arithmetic_shift[/url] | |
With my code below how would I either ignore or remove decimal numbers? I tried typecasting it but that messed up my code. I can't think of any way to make a loop to accept only integers either :(. I don't understand why the scanf is accepting decimal numbers when … | |
Can someone tell me why my compiler won't compile this code and how to fix it? [CODE]void gcd(int x, int y) { if (x > y) { int c; while(1) { c = x % y; return y; x = y; y = c; } if (y > x) { … | |
Can someone please explain the meaning of these return 1 vs return 0 vs break. I know 1 generally means true and 0 generally means false but how would they effect a return statement? Also when would you wanna use a return statement instead of a break statement and vice … | |
Can you please give me a list of all of the % letters that go with int, floats, and doubles in printf and scanf. | |
I have two different parts to my program. My FundRaising.java is my problem. I'm having problems with my print statements. Why are the correct numbers not showing up? I keep getting 0. System.out.println (booster1); System.out.println (booster2); I ask the question to get the numbers and I keep on getting 0 … | |
Can someone please tell me why "int can not be dereferenced" here. contents += cart[i].toString() + "\n [CODE]// ********************************************************************** // ShoppingCart.java // // Represents a shopping cart as an array of items // ********************************************************************** import java.text.NumberFormat; public class ShoppingCart { private int itemCount; // total number of items in the … | |
After I ask the user to enter a number here System.out.println("Enter a number"); number = scan.nextInt(); I would like print the id of each salesperson that exceeded that value and the amount of their sales. I Also want to print the total number of salespeople whose sales exceeded the value … | |
Can someone please explain why this division is not working. This is very simple division but for some reason it won't work. double Percent = Correct / Questions; [CODE]//**************************************************************** // Quizzes.java // // Calculates quizz scores. // // // **************************************************************** import java.util.Scanner; public class Quizzes { public static void main(String[] … | |
Re: Multiply 100 times your percentage which should be a decimal number? If you elaborate on the purpose of this people be able to think of more ways. There's also a for loop and while loop. Doing an array would also be possible if you gave a list of numbers. | |
Why is this an illegal start on an expression? public Account consolidate(Account accnt1, Account accnt2) In my if statement It says name has private access in account. What does that mean and how do i fix it? if((accnt1.name).equals(accnt2.name)) [CODE]//*********************************************************** // TestConsolidation // A simple program to test the numAccts method … | |
Can someone please explain what both of these mean and the good details about them. Please also explain the parameters of how to use it. | |
Could anyone tell me what is wrong this code please. I'm trying to do this. Add a static method Account consolidate(Account acct1, Account acct2) to your Account class that creates a new account whose balance is the sum of the balances in acct1 and acct2 and closes acct1 and acct2. … | |
I'm trying to do some consolidation but I'm not sure on the specific rules of consolidation so I'm having A LOT of difficulty on it. Here's what I'm trying to do. Write a program that prompts for and reads in three names and creates an account with an initial balance … | |
Re: Try using netbeans. There are WAY to many mistakes for me to even try to help right now. I counted 11 big mistakes. Let netbeans guide you through fixing all of the big mistakes. | |
Right now my code runs just the way I want it to. I would like the [CODE]Enter a sentence or phrase[/CODE] part to continue until the user enters "quit". I would like to use a while statement. Every way I have tried to enter phrase not equal to "quit" has … |
The End.