143 Posted Topics

Member Avatar for stannum

[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 …

Member Avatar for WaltP
0
293
Member Avatar for nell16

[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 …

Member Avatar for Ali_2101
0
278
Member Avatar for Vasthor

@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 …

Member Avatar for thines01
0
143
Member Avatar for mweshk
Member Avatar for DJSAN10
0
118
Member Avatar for Sunshine2011

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 …

Member Avatar for DJSAN10
0
106
Member Avatar for rohan121212

You would probably like to post it in the Game Development section or the moderator could just move it there

Member Avatar for DJSAN10
0
110
Member Avatar for krejar

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 …

Member Avatar for DavidKroukamp
0
131
Member Avatar for DJSAN10

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

Member Avatar for DJSAN10
0
451
Member Avatar for sp85202

Maybe you missed this [url]http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/Component.html#setVisible%28boolean%29[/url]

Member Avatar for hfx642
0
135
Member Avatar for shywolf91

[QUOTE]Can some help me fix and improve the code.[/QUOTE] If you are getting any errors or Exception..post them

Member Avatar for augustus7
0
156
Member Avatar for Jay22

[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 …

Member Avatar for MandrewP
0
169
Member Avatar for Vampiricx3

[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] …

Member Avatar for DJSAN10
0
236
Member Avatar for DJSAN10

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 …

Member Avatar for DJSAN10
0
155
Member Avatar for mrbaconbitts

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

Member Avatar for mrbaconbitts
0
130
Member Avatar for gatorgirl

[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 …

Member Avatar for DJSAN10
0
145
Member Avatar for faezshingeri
Member Avatar for faezshingeri
0
223
Member Avatar for themenucha

*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 …

Member Avatar for DJSAN10
0
540
Member Avatar for Loafer
Member Avatar for WaltP
-5
151
Member Avatar for DJSAN10

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

Member Avatar for DJSAN10
0
179
Member Avatar for Valiantangel

[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 …

Member Avatar for DJSAN10
0
90
Member Avatar for Labdabeta

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 …

Member Avatar for Labdabeta
0
224
Member Avatar for yongj

[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 …

Member Avatar for Eagletalon
0
184
Member Avatar for geoffy0404

[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 …

Member Avatar for WaltP
0
989
Member Avatar for Kalle21
Member Avatar for stultuske
0
116
Member Avatar for rushikesh jadha

[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 …

Member Avatar for Rashakil Fol
0
191
Member Avatar for Gaiety

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]

Member Avatar for Gaiety
0
187
Member Avatar for shanki himanshu

[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

Member Avatar for DJSAN10
0
75
Member Avatar for DaniFollower

[B][U]Ok.. so you need to first post some code you have done on your own..[/U][/B]

Member Avatar for DaniFollower
0
95
Member Avatar for sharathg.satya

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.

Member Avatar for dewitt-joyce
0
289
Member Avatar for GoodOldFashion

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

Member Avatar for GoodOldFashion
0
198
Member Avatar for DJSAN10

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 …

Member Avatar for DJSAN10
0
198
Member Avatar for jaymayne

[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 …

Member Avatar for zeroliken
0
257
Member Avatar for mrprassad
Member Avatar for gusano79
0
90
Member Avatar for ghada ali

[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 …

Member Avatar for ghada ali
0
358
Member Avatar for DJSAN10

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 …

Member Avatar for DJSAN10
0
142
Member Avatar for gategold

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]

Member Avatar for DJSAN10
0
91
Member Avatar for taj2011

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 …

Member Avatar for DJSAN10
0
141
Member Avatar for anjelo00

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 …

Member Avatar for anjelo00
0
185
Member Avatar for alafift

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

Member Avatar for masijade
0
144
Member Avatar for samidha

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

Member Avatar for samidha
0
177
Member Avatar for pote86
Member Avatar for gdubz
Member Avatar for jeffw362
Member Avatar for nezachem
0
238
Member Avatar for manojreddy1710

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

Member Avatar for manojreddy1710
0
591
Member Avatar for jackbauer24

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]

Member Avatar for jackbauer24
0
100
Member Avatar for MissJava

[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?

Member Avatar for DJSAN10
0
133
Member Avatar for jhamill

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 …

Member Avatar for DavidKroukamp
0
450
Member Avatar for DJSAN10

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

Member Avatar for jackbauer24
2
114
Member Avatar for scheppy

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.

Member Avatar for scheppy
0
306
Member Avatar for CrewAlien

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 …

Member Avatar for Smartflight
0
315

The End.