Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+5
Strength to Decrease Rep
-1
86% Quality Score
Upvotes Received
12
Posts with Upvotes
11
Upvoting Members
11
Downvotes Received
2
Posts with Downvotes
2
Downvoting Members
2
2 Commented Posts
1 Endorsement
Ranked #858
Ranked #818
~44.1K People Reached
Favorite Forums
Member Avatar for cdea06

I don't see any validity checks done for your dates. He can enter invalid dates like 33/33/2012. Once the dates are validated, the job is easy. [CODE] day1 = yyyy1 * 10000 + mm1 * 100 + dd1 day2 = yyyy2 * 10000 + mm2 * 100 + dd2[/CODE] Check …

Member Avatar for rubberman
0
297
Member Avatar for subith86

I am planning to write an application in windows which will temporarily block the configured websites irrespective of what browser I am using. As I am completely a newbie in this I want to know where to start. Please provide me with any useful links which can help me. If …

Member Avatar for deceptikon
0
122
Member Avatar for dpsh

This [link](http://www.go4expert.com/forums/showthread.php?t=16676) explains better

Member Avatar for dpsh
0
92
Member Avatar for subith86

I have a code which gives the maximum value I can get by filling the knapsack with the optimal set of weights. int arr[5] = {0, 0, 0, 0, 0}; int Weight[5] = {2, 5, 8, 7, 9}; int Value[5] = {4, 5, 7, 9, 8}; const int n = …

Member Avatar for Lucaci Andrew
0
305
Member Avatar for vincent5487

if (0 > spendMinute) { spendMinute = 60 + spendMinute; spendHours-- ; } Add this piece of code at line 15. It will work

Member Avatar for subith86
0
202
Member Avatar for dakoris73

> cin >> Point::m_Xcoord >> Point::m_Ycoord; I didn't take the effort to understand what you are trying to do but there is definitely an error at line 38. You cannot access structure member variables using :: operator unless they are static. You need to create an instance of structure to …

Member Avatar for subith86
0
128
Member Avatar for mrexp21

Boost library is one option. But given that you are a beginner, and you want to go the hard way by using less complex C++ concepts, then think and note down how you will do this task if you were asked to do it manually. 1. take the given day, …

Member Avatar for subith86
0
139
Member Avatar for pokie_da_codie
Member Avatar for subith86

Anybody of you got any idea what this "internal compiler error: Segmentation fault" means? I searched internet, but didn't get anything useful. Then I did my analysis. I found out something peculiar. The code that I am trying to compile is a file for unit testing one of our classes. …

Member Avatar for mitrmkar
0
3K
Member Avatar for caltech
Member Avatar for NathanOliver
0
939
Member Avatar for dmoneyrpyt

Dude, this has hundreds of errors when I compiled. Either you post a proper code or point out which line of code concerns you.

Member Avatar for DJSAN10
0
231
Member Avatar for shreddinit

Why can't you do something like this. [CODE] unsigned int mm; //holds the month unsigned int dd; //holds the day unsigned int yy; //holds the year unsigned int ordinal_day = 0; //holds your ordinal day number //define an array which holds the number of days in each month unsigned int …

Member Avatar for shreddinit
0
293
Member Avatar for Silver-Eye
Member Avatar for zeroliken
0
164
Member Avatar for subith86

Hi, I have overloaded assignment operator like below and it worked perfectly fine. [CODE]void Test::operator = (Test& obj) { this->a = obj.a; this->b = obj.b; } [/CODE] But when I googled more about this, I could see all of the examples used a different prototype like this [CODE]Test& Test::operator = …

Member Avatar for subith86
0
132
Member Avatar for coxxie

Dude, you are giving us a 500 line code and asking us to find the bug. Why can't you debug a bit on your own and post only that code portion which is the reason for your "lock up"?

Member Avatar for coxxie
0
3K
Member Avatar for prasenjit_das
Member Avatar for subith86
0
67
Member Avatar for Sh0gun

why is there no enclosing brackets for the lines under for loop? Is it intentionally missed out? From the logic under for-loop, I don't think so

Member Avatar for subith86
0
174
Member Avatar for prasenjit_das

A tricky way, may not be the best way. Here it is: [CODE]#include <iostream> using namespace std; int main() { int a[2] = {1,5}; long addr1 = (long)(&a[0]); long addr2 = (long)(&a[1]); cout<<(addr2 - addr1)<<endl; return 0; } [/CODE] take absolute value of addr2-addr1 inorder to avoid a negative answer.

Member Avatar for Ali_2101
0
153
Member Avatar for MochiAnjali

Ok, if you want to retrieve the info at the last use "back" [CODE]a_student.assignments.back()[/CODE] If you want to retrieve from anywhere else using an index, use "at" [CODE]a_student.assignments.at(4)[/CODE] See this [URL="http://www.cplusplus.com/reference/stl/vector/"]link[/URL] for more info

Member Avatar for subith86
0
200
Member Avatar for picogenkaku

at line 29 you are setting seconds back to 0. So it's an infinite loop. Use a different variable in for loop condition.

Member Avatar for picogenkaku
0
236
Member Avatar for general07z

I didn't take the trouble in going through your entire code. But what sounds to me is that you have to use a static variable as ID. Initialize it to 1. increment it every time you add a patient.

Member Avatar for WaltP
0
2K
Member Avatar for phorce

[QUOTE=phorce;1760048]Hello, basically I want to return an array from a function (So I don't output things in the class - just main) But I seem to get the error: "invalid types 'int[int]' for array subscript" Here is the code: [code] #include <iostream> using namespace std; int matrix() { int matrix[10] …

Member Avatar for phorce
0
198
Member Avatar for pattmorter

[QUOTE=nezachem;1760178]Run away from that teacher as fast as you can. [CODE]y = 2*y++ + --x;[/CODE] [/QUOTE] Correct me if I'm wrong. But how is this an undefined behavior? I agree that the below line will give undefined behavior. [CODE]x = y++ * --y;[/CODE] Because we cannot predict which one (y++ …

Member Avatar for Ali_2101
0
193
Member Avatar for nell16

[QUOTE=nell16;1756980]1. Write a c++ program that generates the following series: 0 -1 4 -9 16 -25 36 -49 64 -81 100 and also this one - Nell[/QUOTE] Break it into two series 0 4 16 36 64 100 (square of even numbers starting from zero) -1 -9 -25 -49 -81 …

Member Avatar for Ali_2101
0
259
Member Avatar for butler273

try this :) [CODE]while(std::cin >> numberinput){ //std::cin >> numberinput; LinkedList.InsertFront(numberinput); }[/CODE]

Member Avatar for subith86
0
151
Member Avatar for shean1488

[QUOTE=shean1488;1758193]Yes it is, but not the way I want. The output is different[/QUOTE] It's pretty simple. You are not looping fully while printing. Make this change in line 40 - 43 (extra line added) and it will work. [CODE]for( i=0; i<c ; i++) { printf("%c", line[i]); } printf("%c", line[i]);[/CODE]

Member Avatar for subith86
0
139
Member Avatar for arubajam

use vector::assign See this [URL="http://www.cplusplus.com/reference/stl/vector/assign/"]link[/URL]. There is a similar example given.

Member Avatar for subith86
0
177
Member Avatar for shean1488

[QUOTE=thines01;1757547] The easiest way is just to set it to NULL.[/QUOTE] How is that possible? If you set it to NULL, the value will still be there and it is zero. [CODE] int a[5] = {1,2,3,4,5}; printf("%d", sizeof(a));//prints 20 as the size a[4] = NULL; printf("%d", sizeof(a));//prints 20 again [/CODE] …

Member Avatar for Smileydog
0
10K
Member Avatar for chamika.deshan

Are you asking what templates are? Or what is the job of template in your code? If you don't know what templates are, before trying to understand this code, you need to learn about templates. Take a good book or take some online material about templates and learn. I will …

Member Avatar for L7Sqr
0
161
Member Avatar for bennetk2

You are calling a non-const function by a const object. Hence the error. Make the functions as const and you'll get rid of this error. [CODE]int statistic::length() const { return amount; }[/CODE] There seems to be another solution to this. I haven't tried it and I seriously believe it is …

Member Avatar for gusano79
0
332