Jishnu 160 Posting Pro

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.

Jishnu 160 Posting Pro

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.

Jishnu 160 Posting Pro

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!

Jishnu 160 Posting Pro

I think these are the kind of threads that need to be closed.

Jishnu 160 Posting Pro

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.

Jishnu 160 Posting Pro

//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!

Jishnu 160 Posting Pro

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.

Jishnu 160 Posting Pro

Ok. I was not aware of that. Thank You!

Jishnu 160 Posting Pro

I would really appreciate if someone knows and could explain how the program works.

Jishnu 160 Posting Pro

>write a bigger program.

How? By increasing the number of _-_-......-_-_ ?

Jishnu 160 Posting Pro

>computing its own area.

Whose area? I didn't get it.

Jishnu 160 Posting Pro

>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.

Jishnu 160 Posting Pro

>System.out.printf( "The total value of the inventory is $%.2f\n\n", total );

Same as above.

Jishnu 160 Posting Pro

>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.

Jishnu 160 Posting Pro

>Is this the correct way?

Absolutely. You can see the difference it makes for yourself.

Jishnu 160 Posting Pro

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

Jishnu 160 Posting Pro

Thank you :)

Jishnu 160 Posting Pro

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.

Jishnu 160 Posting Pro

This is your first post, but now onwards, use code tags to display your code in the posts.

Jishnu 160 Posting Pro

What kind of a way is this to give thread titles ?!

Jishnu 160 Posting Pro

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?

Jishnu 160 Posting Pro

>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.

Jishnu 160 Posting Pro

You found the algorithm. That is enough. Go ahead.

Jishnu 160 Posting Pro

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.

Jishnu 160 Posting Pro

>Why?

I sincerely want to know why not?

Jishnu 160 Posting Pro

>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.

Jishnu 160 Posting Pro

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.

Jishnu 160 Posting Pro

>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.

Jishnu 160 Posting Pro

>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.

Jishnu 160 Posting Pro

>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.

Jishnu 160 Posting Pro

I understood now. Thank you!

Jishnu 160 Posting Pro

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?

Jishnu 160 Posting Pro

Proper formatting please...

Jishnu 160 Posting Pro

What nonsense code have you submitted?! I fully agree with Ancient Dragon.

Jishnu 160 Posting Pro

Does it mean that there is a trade-off between memory & speed of execution?

Jishnu 160 Posting Pro

Stop posting mere problem statements of programs.

Jishnu 160 Posting Pro

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.

Jishnu 160 Posting Pro
#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?

Jishnu 160 Posting Pro

Give appropriate names to your threads

Jishnu 160 Posting Pro

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.

Jishnu 160 Posting Pro

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.

Jishnu 160 Posting Pro

value on the left hand side of an expression containing assignment operator

Jishnu 160 Posting Pro

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?

Jishnu 160 Posting Pro

Please try to explain in a bit detail about 'local lookup tables'.

Jishnu 160 Posting Pro

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.

Jishnu 160 Posting Pro

India

Jishnu 160 Posting Pro

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 error

undefined reference to main.

i'm getting the error when trying to compile a file without a main function with -Wall option

Jishnu 160 Posting Pro

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.

Jishnu 160 Posting Pro

Yup, that worked ! Thanks ! [:)]

Jishnu 160 Posting Pro

Actually, even after this modification, the error persists ! HELP !