143 Posted Topics
Re: [QUOTE]int input(char s1[], char &ch, int &state, int pos)[/QUOTE] Here &state means address of state, and you are passing value of state here : [QUOTE]input(s1,ch,state,pos);[/QUOTE] There is no need to pass address of state since you are returning state. If you want to pass by reference then you will have … | |
Re: [QUOTE]1. Write a c++ program that generates the following series: 0 -1 4 -9 16 -25 36 -49 64 -81 100[/QUOTE] You simply need to print the squares of a number . You can use square_of_num = num * num. Also every odd number has negative sign. It means if … | |
Re: @Vastor Always!! C++ never should be a bad choice for anyone. :) If you are interested in maths then if you go deeper you will realize programming is in some or the other way Maths. Other computer fields where you yourself will use lot of mathematics is game programming or … | |
Re: int i should be outside struct definition. Still post what error you are getting | |
Re: To me your code seems ok logically. Just a small guess, are you sure you enter a newline in your text file at the end i.e. after 15. If not just give it a try. I am not sure this will work but can't think of anything else at this … | |
Re: You would probably like to post it in the Game Development section or the moderator could just move it there | |
![]() | Re: I did not understand your question.It is going in the if statement for the first time according to what output you are getting. I suppose your problem is something else. [QUOTE]done = true;[/QUOTE] and [QUOTE]while(! done)[/QUOTE] Assuming initially value of done was false, so !done evaluated to true and you … |
Any file's primary header contains some things which are common to all operating system like entry point function, time stamp etc and then other things. What is the purpose of keeping this time stamp in the header. Thanks | |
Re: Maybe you missed this [url]http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/Component.html#setVisible%28boolean%29[/url] ![]() | |
Re: [QUOTE]Can some help me fix and improve the code.[/QUOTE] If you are getting any errors or Exception..post them ![]() | |
Re: [QUOTE]int LinearSearchArray ( const int list[], int numEless, int value) { //<<--------this is where I get my error int index=0; int position= -1; bool found = false; while(index < numEless &&!found) { found = true; position = index; } index ++ } return position }[/QUOTE] There is no semicolon after … | |
Re: [QUOTE]I have an idea in mind. I want to create a Terminal (Windows Command Prompt) based completely in Java, capable of creating, compiling, editing, etc for Java files. I would like this to also resemble the look of Terminal/Command Prompt. Being the black background, and the text start like below.[/QUOTE] … | |
Okay, so I don't know much about this and maybe that is why the doubt. I am pretty sure there must be some precaution if some one tries to create (can say a virus) like this : [CODE] while(1) { /* creat system call. to create files continuously. Not difficult … | |
Re: [QUOTE]for (k = 1; k < i*2; )[/QUOTE] i's maximum value will be 8 . Hence condition k < i * 2, means k can at the max be 16 . It will never go ahead of 16. | |
Re: [QUOTE] public abstract class Student extends Person { protected Course[] courses; [/QUOTE] and [QUOTE] public class Course { private Student[] students; [/QUOTE] I think this MIGHT be the reason. If you first create student object, course will be empty and if you first create course object student there will be … | |
Re: Maybe you would like to post the code where you have called replace function. | |
Re: *POST YOUR CODE USING CODE TAG *[U][B]FORMAT[/B][/U] YOUR CODE *POST THE ERRORS THAT THE COMPILER IS GIVING YOU [QUOTE]while(1)[/QUOTE] You need to put the opening brace [QUOTE]if(check_if_empty(x2,y2));[/QUOTE] What is this for? [QUOTE]for(i=x1+1,j=y1+1;i<x2;j<y2;i++,j++)[/QUOTE] Semicolon between two conditions -wrong !!! There will be many more I suppose. Please follow the above three … | |
Re: [QUOTE]Who can do it in C++??[/QUOTE] Maybe ,you can | |
I want to create a regular expression that matches with the string "B. Hello" or "C. Hello" and so on.. I tried number of things and finally came up with this [CODE]String REGEX = "[A-Za-z]"+Pattern.quote(".")+" Hello";[/CODE] but still no luck.. I tries using '\s' for space but still not working. … | |
Re: [QUOTE].if the above condition is false i dont want my code to go further and calculate the input.How and i able to do this.Presently everytime i enter an invalid number ,it still processes the output but also come up with the statement"invalid number".[/QUOTE] If you want to straight away exit … | |
Re: Whenever a function is called , it is pushed on to a stack (called as a frame). Whenever a function returns, it's frame is popped out. This is how flow is maintained. Now , suppose you call a function inside main() , and that function calls exit() , which is … | |
Re: [QUOTE]int *p = &x;[/QUOTE] You can break this statement as [CODE]int *p; // Define a pointer to an integer (p is a variable that // is capable of holding address of an integer variable p = &x; // & can be said to be 'address of' operator. hence // assign … | |
Re: [QUOTE]if (number % x == 0) { bool NotPrime=FALSE; cout << " This is a Composite" << endl; } [/QUOTE] You don't need to re declare NotPrime. This will create a new variable in a new scope and destroy it as you leave if block. Basically, you don't need to … | |
Re: Didn't quite get your question... What EXACTLY are you looking for ? | |
Re: [QUOTE]Quote ... which is the best programming language between java and .net. .NET isn't a language, it's a framework. You probably mean Java and C# as they're very similar in terms of syntax, but it's still impossible to compare languages without a very specific context and well defined points of … | |
Re: fork returns two values ,0 for child process, and pid of child for parent process. Hence , your if is always true and it runs for parent. If you want some code to run for child you will have to check [CODE]if(fork() == 0){ // your code }[/CODE] | |
Re: [QUOTE] if(a[i]!=52||a[i]!=55) //this condition is not working?[/QUOTE] Since you want to count those which are not 4 or which are not 7, this should work according to me... [CODE]if(a[i]!=52 && a[i]!=55)[/CODE] Use AND condition | |
Re: [B][U]Ok.. so you need to first post some code you have done on your own..[/U][/B] | |
Re: Compile time errors are [B]syntactic errors[/B], they are notified at [B]compile time[/B] i.e. before you run your program . Exceptions are [B]run time errors[/B]. Compiler does not recognize them. You know you have encountered an exception only once you execute a program. | |
Re: Ok..the thing is..when you want to display the list ,you have to traverse the list from the beginning(in a loop), and display each element until end of list is reached. What you are doing will only display current data that you have entered. Basically, linked list are dynamic in nature. … | |
Hey guys, Could you please suggest some nice/catchy names for a start up software company. Looking for a name that has good meaning . I went through a few names , some Greek Gods names, even names of few chemical elements that I found have good meaning. Your suggestions are … | |
Re: [QUOTE]for (a = 0;j< size-1; j++)[/QUOTE] What is 'a' ? I think it should be j ? [QUOTE]void swap (int *x,int *y);[/QUOTE] You have written a function prototype inside another function. That is wrong [QUOTE]void dataSort (float sLengthArray[],float rSlopeArray[],float speedArray[], float size)[/QUOTE] I find only three arrays here,not 4 [QUOTE]Could … | |
Re: Why are you expecting it to be 4 bytes? 3 characters, 1 byte each , total 3 bytes. | |
Re: [QUOTE]t HelloWorld.main(HelloWorld.java:28) [/QUOTE] Which is your line number in the code. I guess it is this : [QUOTE] ConfigurationManager cm = new ConfigurationManager(new URL("http:\\www.google.com"));[/QUOTE] You need to this correction JamesCherill said : [QUOTE]"http:\\www.google.com" In Java \ is a special character, used to start escape sequences in string literals. "\\" in … | |
I am reading Kernighan and Ritchie, and honestly, I am not able to understand anything in the following sentence I encountered while reading: [B]Any integer is converted to a given unsigned type by finding the smallest non-negative value that is congruent to that integer, modulo one more than the largest … | |
Re: You will get a pretty decent idea from this post [URL="http://www.daniweb.com/software-development/computer-science/threads/19933"]http://www.daniweb.com/software-development/computer-science/threads/19933[/URL] | |
Re: What error are you getting? [QUOTE]for(int i = row; row > 0; row--)[/QUOTE] Why row>0 and row--. Should it not but i>0 and i-- ? Why have you put the code inside for loop in comments? Your function check_column is returning true in any case. And ident your code and … | |
Re: The number of lines/rows in your output is 2*n - 1 where n is the number you enter. For ex. if you enter 5 , you will have 9 rows, if you enter 3, you will have 5 rows. Hence, your outer for loop should have a condition that is … | |
Re: First of all, use code tag when you post your code. Secondly, format your code. And as for your exception, you need to add the jar file of your driver to the path. What IDE are you using? Or are you doing it via command line.? | |
Re: Maybe because [QUOTE]struct mottab //declaring mot table structure { char mn[6]; int Class; char opcode[3]; };[/QUOTE] mn[] is of size 6 and ORIGIN is of size 7 including '\0'. Try changing the size of mn and see if it works | |
Re: You might also want to take a look at http://www.aspose.com/ | |
Re: Could you paste the entire output that you are getting? | |
Re: > if (f==0){ > printf("file doesnt exist?!\n"); > } > f is a pointer. Your if condition should check whether it is null. And if so print the message and exit. | |
Re: Inheritance is one of the object oriented concepts . Check these out : [URL="http://www.inf.ufsc.br/poo/smalltalk/ibm/tutorial/oop.html"]http://www.inf.ufsc.br/poo/smalltalk/ibm/tutorial/oop.html[/URL] [URL="http://docs.oracle.com/javase/tutorial/java/concepts/inheritance.html"]http://docs.oracle.com/javase/tutorial/java/concepts/inheritance.html[/URL] | |
Re: [QUOTE]I have this coursework to do and I don't know why my code is not working[/QUOTE] What is not working , post in brief. Are you getting an exception somewhere? | |
Re: How about using flags for every pattern that occurs. Since you want 'aeiou' order to be maintained , you can have 5 flags for ,say a, ae , aei ,aeio , aeiou. Only if aFlag is true,aeFlag can be true. Only if ae flag is true and you encounter an … | |
I don't know how many of you all know about this already. But I found this pretty interesting. Check it out : [URL="http://www.gnu.org/fun/jokes/unix-hoax.html"]http://www.gnu.org/fun/jokes/unix-hoax.html[/URL] Enjoy..:P :-O :D | |
Re: First of all ,use code tag whenever you put a code. As for your solution you need to add an empty implementation of keyTyped() in your class since you have inherited java.awt.event.KeyListener ,you will need to implement all methods specified in it. | |
Re: Is this an assignment ? Did you try writing any code ? Anyway, what you can do is ask the user what does he want to calculate ,whether V, I, or R. Take other two values as input from him. Using either if-else or switch you can decide which formula … ![]() |
The End.