what do I put in the num1 = strtoul(argv[]) to take the number entered in the command line prompt?
You will have to convert these strings containing numbers to integers by an appropriate function.
what do I put in the num1 = strtoul(argv[]) to take the number entered in the command line prompt?
You will have to convert these strings containing numbers to integers by an appropriate function.
I don't know about the stroul function.
I also have no idea what you are planning to do with this.
if (argc == 3)
{
}
Let me try. arg[0] refers to the name of exe, which is tprime over here. Then onwards, arg[r] refers to the rth command line argument.
I finally figured out command line arguments
what do I put in the num1 = strtoul(argv[]) to take the number entered in the command line prompt?
A contradiction!
I think these are the kind of threads that need to be closed.
first u should know something about that so refer it first and share your ideas.
Differing a bit over here, you must be very much clear about the basics and you must be specific regarding what doubt/s you have.
//Jkd1.6.0_02
Just a very very minor point. It should be
//Jdk1.6.0_02
JDK is Java Development Kit.
Jkd is different, they are my initials!
You calling variables that are return by get methods instead of calling methods to get this variables
Ah! I didn't notice this error while inspecting the program for the first time. I really need to keep my eyes wide open.
Ok. I was not aware of that. Thank You!
I would really appreciate if someone knows and could explain how the program works.
>write a bigger program.
How? By increasing the number of _-_-......-_-_ ?
>computing its own area.
Whose area? I didn't get it.
>formatString += "Units: $%.d\n";
should be
formatString += "Units: $%d\n";
I think this will remove the following errors:
at CD.toString(InventoryPart3.java:166)
at InventoryPart3.main(InventoryPart3.java:35)
Try compiling it after the above stated changes.
>System.out.printf( "The total value of the inventory is $%.2f\n\n", total );
Same as above.
>System.out.printf(inventory[counter].toString());
I do not think there is any function like printf in Java. It should be either print or println.
>Is this the correct way?
Absolutely. You can see the difference it makes for yourself.
Hey, what does the following code do?
#define _ -F<00||--F-OO--;
int F=00,OO=00;
main()
{
F_OO();
printf("%1.3f\n",4.*-F/OO/OO);
}
F_OO()
{
_-_-_-_
_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_
_-_-_-_
}
I found this interesting question from http://www.techfest.org/archives/tf07/wired_logic/codemaestros/code.c
Don't expect anyone to write the entire code for you. Post your own efforts. In case you post your code, use code tags. This way you won't get any help.
This is your first post, but now onwards, use code tags to display your code in the posts.
What kind of a way is this to give thread titles ?!
Why does the JVM initialise the data fields with default values if no constructors are defined in any class? What is the need for such a procedure of calling the default constructor?
>Uhm, do you know if a similar titled The C++ Language is as good?
Yes. Besides it, refer The Complete Reference C++ by Herbert Schildt.
You found the algorithm. That is enough. Go ahead.
The logic is there in your mind. But you have posted something that is very much far from a sound error-free program. Either you were in too much hurry or you need to clear your basics.
>Why?
I sincerely want to know why not?
>Or if it doesn't ,what does a programming platform mean to be?
Check your grammar.
>Did it mean than it can work both in Windows and Linux.
Yes, it does.
You will get help once you post your efforts. But what you are asking is just primary searching which is a very very basic concept. I don't think you will need anyone's help for this if you try it on your own.
>As reported earlier I used TC Version 2.01 and it did not have that problem.
I have not tested it on TC version 2.01. There may be a difference between different versions. No issues from my side.
>Turbo C Ver 1 also prints, so it's probably a bug at least through ver 3. Borland 5.5 works as expected.
That is exactly what I found.
>Salem agreed with you if the code you posted is exactly the code you're running. What more are you looking for?
It is the first time that I came across a problem where it is the compiler's fault. So I just wanted to confirm.
I understood now. Thank you!
No, I know that the semicolon at the end of for loop is not there. I am very much clear about that. I think that the compiler is faulty. I cannot perceive any other logical explanation. I posted to know if anyone thinks otherwise.
If that is your code, then your compiler is broken. It does what it says with gcc.
But if this is your code (note the 1-character difference), then "Hello" is printed once.
#include<stdio.h> int main() { for(;0;); printf("Hello"); return(0); }
Now, did you paste what you tried, or did you recite from memory what you thought you tried?
Proper formatting please...
What nonsense code have you submitted?! I fully agree with Ancient Dragon.
Does it mean that there is a trade-off between memory & speed of execution?
Stop posting mere problem statements of programs.
http://www.daniweb.com/forums/thread97328.html
Atleast show your code (efforts) & specify where you are stuck up. You are expecting that someone will write the entire code for you. You've not even specified what your specific problem is about.
Write a c program that inputs the names of the 5 students and their marks in 5 course units. the program must calculate the average for each student. If the average of the students's marks is less than 50, then your program should print against the student the string"Sorry try next year".Your progrma should also print out the student's names and average mark in descending order startisng with the student with best marks up to the one with least marks.
#include<stdio.h>
int main()
{
for(;0;)
printf("Hello");
return(0);
}
This code should not give any output, but it is printing Hello once. I'm using TC++ 3.0. Is something wrong with the compiler?
Atleast show your code (efforts) & specify where you are stuck up. You are expecting that someone will write the entire code for you. You've not even specified what your specific problem is about.
Write a program to find the number of times that a given word(i.e. a short string) occurs in the sentence(i.e. in a sentence!).
Read data from the standard input. the first line is a single word, which is followed by general text on the second line. read both up to a newline character, and insert a terminating null before processing.
Typical output should be:
The word is "the".
The sentence is "the cat sat on the mat".
The word occurs 2 times.
The first one is a pointer to a string. The second one is a pointer to an array of strings. You are not noticing the difference as both of them can be initialised in a similiar way. You will notice it once you try to modify these pointers.
value on the left hand side of an expression containing assignment operator
I don't think that they can be useful. So I am wondering whether they can be practically implemented or not. I still do not know whether they have some practical application or they are just a theoretical concept. Someone please help.
So have you come up with an answer to this homework question yet? When do you think they could be useful?
Please try to explain in a bit detail about 'local lookup tables'.
There is more material available for developing AI for chess. This is because it is more popular than othello. A good start would be to go through AI by Kevin & Knight. Then go through online resources for chess programming. TSCP is a really good starting point. Search for it on the web. Then, having understood the concepts in a solid way, apply them to othello. You will find it easier as evaluation function in case of othello is far less complex as compared to that of chess. I am also thinking of building AI for othello in Java after a month or so. All the best.
The error implies that there is some reference to main inside the functions in the file you are trying to compile. As you have not defined main, it will not compile. Try to put the file here so that the error can be located.
hello
does anyone knows the meaning of the errorundefined reference to main.
i'm getting the error when trying to compile a file without a main function with -Wall option
Herbert Schildt in The Complete Reference Java 2 says,"Because it is static, it must access the members of its enclosing class through an object. That is, it cannot refer to members of its enclosing class directly. Because of this restriction, static nested classes are seldom used."
Can we use static nested classes practically? If yes, please demonstrate it with help of an example program.
Yup, that worked ! Thanks ! [:)]
Actually, even after this modification, the error persists ! HELP !