107 Posted Topics

Member Avatar for Unidennn

fmax takes only two variables as input. So you can only use fmax(a,b) For three variables a,b,c use something like [CODE] d = fmax(a,b); e = fmax(c,d) [/CODE] e will be the max of a,b,c

Member Avatar for Unidennn
0
118
Member Avatar for ajjg123

You have followed some thinking process to arrive at the answer, right? Now convert this into pseudo code and finally code. If you post atleast the pseudo code here, you will get some help.

Member Avatar for Lerner
0
147
Member Avatar for theonlywalks

You could consider [URL="http://www.cplusplus.com/reference/clibrary/cstring/strtok/"]strtok[/URL] instead of sscanf. I hope the large sized arrays are justified. You could end up corrupting your stack.

Member Avatar for Dave Sinkula
0
133
Member Avatar for wilsonz91
Member Avatar for halluc1nati0n

I have seen this problem before of large arrays on stack. Just declare it as a global.

Member Avatar for halluc1nati0n
0
209
Member Avatar for asa88

Please take a look at how the [URL="http://cplusplus.com/reference/string/string/c_str/"]c_str[/URL] function is used.

Member Avatar for thomas_naveen
0
115
Member Avatar for johndoe444

Welcome to the club!! However, it is fairly easy to identify SEG faults once you can competently use a debugger. Compile with -g option to use binary with debugger. There are some cases where even the debugger can't help you. Thorough analysis of the code only can help you there.

Member Avatar for thomas_naveen
0
127
Member Avatar for DCvonB

You are having a problem in line 32-36. Instead of iterating through the linked list and adding your element at the end, you are pointing your head node to the new node and the new node points to your head. All the intermediate nodes are lost. You are left with …

Member Avatar for DCvonB
0
308
Member Avatar for nuB

Move curly brace from line 60 to line 28. As it is all your functions are implemented inside main. Remove the semi-column at the end of lines 29,37,42,47 & 52. these are implementation signatures. Change the returns as previously suggested. Add a line to do the operation first and then …

Member Avatar for nuB
0
190
Member Avatar for Swiftle

Are you allocating memory to Index? I can see "Index[Counter] = new" But I don't see "Index = new" anywhere or it's equivalent.

Member Avatar for mitrmkar
0
144
Member Avatar for jonyb222

I would like to see Event.h Can you please upload the same? Also, posting in bits and pieces of code is most irritating. You are posting it because you don't know what the error is. Then how do you expect yourself to understand what part of code is causing the …

Member Avatar for jonyb222
0
558
Member Avatar for DARK_BYTE

Issue is with your while loop. It was not exiting properly. Change [CODE]while(!myFile.eof())[/CODE] to [CODE]while(getline(myFile,line))[/CODE] and comment out the getline inside the while loop. (no need for two getline function calls)

Member Avatar for Clinton Portis
0
110
Member Avatar for prockaz

Spelling mistake at 64 [CODE]Employee::Employee()[/CODE] 70,71 [CODE] firstName = first; lastName = last;[/CODE] You are assigning a character to a character pointer. An approach would be to change this to take char pointers as input and use a string function to copy. Allocate memory for the pointers in the constructor. …

Member Avatar for thomas_naveen
0
306
Member Avatar for Cristofor

Change the getmax implementation as [CODE]template <class T> T pair<T>::getmax (){[/CODE] In main use [CODE]pair<int> myobject(100,75);[/CODE] Also rename pair as pair1, as there is a naming conflict in std namespace. (else remove using and use std:: as required)

Member Avatar for Cristofor
0
1K
Member Avatar for MJaske

First of all you are passing radius to calcPrism and calcPyramid. In those functions, the calculation is not based on radius. The compiler fails to give any error , because you have the length,height and width defined as globals.

Member Avatar for thomas_naveen
0
160
Member Avatar for techie929
Member Avatar for gnarlyskim
Member Avatar for gnarlyskim
0
146
Member Avatar for mrinal.s2008

Check whether your stream is open using [URL="http://www.cplusplus.com/doc/tutorial/files/"]is_open().[/URL] Use [URL="http://www.cplusplus.com/reference/std/iterator/istream_iterator/"]eos[/URL] as the exit criteria for the istream_iterator.

Member Avatar for mitrmkar
0
300
Member Avatar for Jeff_5_7

In C++, arrays start from index 0. In your case that would be row 0 column 0. Not sure what you mean by entry point. Do you want to start from row 1 column 1? '=' is not a comparison operator. It is an assignment operator.

Member Avatar for Jeff_5_7
0
519
Member Avatar for Anarionist
Member Avatar for Anarionist
0
158
Member Avatar for webdragon89

From your explanation, it looks like the problem could be the getVal function. Could you try and re-write the for loop in getVal so that there is a proper exit condition here? [CODE]for (j=0;nent--;j++) [/CODE] I am not having access to a compiler and hence can't say whether it is …

Member Avatar for Nick Evan
0
275
Member Avatar for wendell_
Member Avatar for mmgoicochea

The functions num and results have been defined initially with no arguments. In function main, those functions are called with no arguments. But, while implementing the functions, arguments are present. The linker is trying to look for the functions called in main. Since it is not able to find the …

Member Avatar for mmgoicochea
0
113
Member Avatar for tom384

First of all let me apologize that I cannot give too much attention to your problem. But the first thing that I would do would be to rename my Polygon class, since it looks like there are two classes with the same name. Another thing that could be done would …

Member Avatar for tom384
0
358
Member Avatar for ainct

Is [URL="http://www.creativecrash.com/downloads/applications/os-utils/c/unix-commands-in-windows"]this[/URL] what you are looking for?

Member Avatar for ainct
0
153
Member Avatar for falconxxxx

Reading your problem statement makes no sense, what exactly is the problem that you are facing?

Member Avatar for anishakaul
-2
213
Member Avatar for kylcrow

[CODE]int succeed = ParseCommandLine(buf, data*);[/CODE] The above line does not make sense. You want to pass the address of data to the function ParseCommandLine. So the code should be [CODE]int succeed = ParseCommandLine(buf, &data);[/CODE]

Member Avatar for kylcrow
0
157
Member Avatar for Mz3g

You might want to consider changing [CODE]c= n[/CODE] and [CODE]r= m[/CODE] with [CODE]c== n[/CODE] and [CODE]r== m[/CODE]

Member Avatar for Mz3g
0
93
Member Avatar for Ana_Developer

What error are you getting? From looking at your code it looks like [CODE]Action();[/CODE] the above way of defining your default constructor could be the problem. If you would post the actual compilation error, I would be able to help you better.

Member Avatar for Ana_Developer
-1
225
Member Avatar for ubi_ct83
Member Avatar for XStrong
Member Avatar for thomas_naveen
0
155
Member Avatar for gianx80
Member Avatar for Salem
0
247
Member Avatar for thirupathireddy

[CODE]memcpy(root->message,&in_rec,s_siz); memcpy(temp->message,&in_rec,s_siz); [/CODE] You need to allocate memory for the message as well. Otherwise you can make message a non pointer variable. [CODE]struct host_msgs_list { struct host_msgs_struct message; struct host_msgs_list *next; }; [/CODE]

Member Avatar for abhimanipal
0
113
Member Avatar for rena0514

You could either modify the for loop reading the stream to regulate it to read only till EOF or add more elements to your data file

Member Avatar for vmanes
0
157
Member Avatar for Rmj001

try[CODE] itemTotal = total; itemPrice = price; [/CODE] instead of [CODE] setItemTotal = total of cars; setItemPrice = price per car; [/CODE]

Member Avatar for Rmj001
0
341
Member Avatar for xxunknown321

use [CODE]yOn = scn.next();[/CODE] instead of [CODE]yOn = scn.nextLine();[/CODE] at 196

Member Avatar for xxunknown321
0
395
Member Avatar for enderes05

There is no need to beg. Looks like [CODE]void div(){[/CODE] is not getting closed. Put one more curly brace before main() [EDIT] use [CODE]int main()[/CODE]

Member Avatar for lsandling
-1
240
Member Avatar for jemz

The second link given by BJSJC gives you most of the info required. Check out the below link as well. [URL="http://java.sun.com/docs/books/tutorial/2d/printing/printable.html"]http://java.sun.com/docs/books/tutorial/2d/printing/printable.html[/URL]

Member Avatar for thomas_naveen
0
120
Member Avatar for kendaop

If you want more information of design patterns it would be a good idea to refer to a book like HeadFirst. I am sure that googling also would result in a good number of sites giving details of all the design patterns out there. The basic idea of singleton is …

Member Avatar for JamesCherrill
0
155
Member Avatar for techno_weenie

In the while loop that you are using for printing why don't you do an strstr and extract the value that you need? Something like [CODE] strstr(result, "SRC="); [/CODE]

Member Avatar for techno_weenie
0
152
Member Avatar for notsogood

You are referring to two different functions in your code. a_star and a_start. Try renaming them to the same name. Ex: a_star is defined at line 26. a_start is implemented at line 179. Rename them both to a_star and modifying your function calls also should help.

Member Avatar for thomas_naveen
0
131
Member Avatar for Iam3R

You should be using [CODE]#ifdef fst[/CODE] in your code check instead of [CODE]#if (fst == 1)[/CODE] [CODE]#define fst 1 [/CODE] The above line is an indicator to replace fst with 1 whenever seen. So (fst == 1) translates to (1==1) The #define is used for many purposes like , 1)For …

Member Avatar for Dave Sinkula
0
103
Member Avatar for cwarn23

Have you tried using sprintf to print the hex formatted numbers onto a string.

Member Avatar for Poincarre
0
416
Member Avatar for agurrea

Why should 10.1 be greater than 10.5? Can you add your code to the post so that there is more clarity?

Member Avatar for agurrea
-1
194
Member Avatar for smbee

I haven't gone through either the problem or the solution. But I have a query. Why are you printing out the address of the returned variable. In printf on line 24, shouldn't you be printing out life_test instead of &life_test.

Member Avatar for smbee
-1
308
Member Avatar for Soileau

Putting a break at the end of each case statement should work. [CODE]case 4: printf("Enter the bank's rating: "); scanf("%s",rating); printf("%s\n\n", rating); break; [/CODE]

Member Avatar for WaltP
0
182
Member Avatar for nagajyothi

try copying the following line at the top of your file [CODE]#define _GNU_SOURCE [/CODE]

Member Avatar for Ancient Dragon
0
141
Member Avatar for Memo..~

The code compiles if you make the below changes [CODE] JTextField T1,T2,T3,T4; JPanel P1; JPanel P2; JPanel P3; public BodyMass() { P1=new JPanel(); P2=new JPanel(); P3=new JPanel(); [/CODE] Enclose your multiple statements after if and else in curly braces. An example: [CODE]else if (n.equals("ORANGE")) { P1.setBackground(Color.ORANGE); P2.setBackground(Color.ORANGE); P3.setBackground(Color.ORANGE); } [/CODE] …

Member Avatar for Ezzaral
0
153
Member Avatar for jayrana

You could try giving the prototype of the function at the start of the program. [CODE]void Wander(double *forwardSpeed, double *turnSpeed); [/CODE] Kindly use code tags while posting code..

Member Avatar for thomas_naveen
0
66
Member Avatar for speakvair

Check whether you are closing the file after opening it. In most cases you will need to open the file only once. (depends on your requirements) Can you copy your code here?

Member Avatar for thomas_naveen
0
162

The End.