Search Results

Showing results 1 to 40 of 66
Search took 0.01 seconds.
Search: Posts Made By: skatamatic ; Forum: C++ and child forums
Forum: C++ Jun 2nd, 2009
Replies: 13
Views: 900
Posted By skatamatic
To make it a more secure method, you could do a binary write to the file with the time of day (in clock ticks) that the file was written, the number of guesses that occured, and a strange binary...
Forum: C++ Apr 28th, 2009
Replies: 35
Views: 2,009
Posted By skatamatic
This would require a data aquisition card, an instrumentational amplifier attached to a very sensitive inductor, and amplified so that the minute changes in electrical forces in the air generate a...
Forum: C++ Apr 28th, 2009
Replies: 35
Views: 2,009
Posted By skatamatic
Umm...What point was made, exactly, with that post?

and kelechi96,
don't get discouraged too much, some of the people around here can be a little ignorant at times, but will usually help you out...
Forum: C++ Apr 28th, 2009
Replies: 11
Views: 496
Posted By skatamatic
I would sugguest attending class.
Forum: C++ Apr 28th, 2009
Replies: 35
Views: 2,009
Posted By skatamatic
An example of this would be to measure the amount of electrical energy in the air at any given point using some sort of analog device, which then converts this into a voltage difference, which is...
Forum: C++ Apr 24th, 2009
Replies: 25
Views: 1,684
Posted By skatamatic
Your function makes little to no sense to me. Just think about injecting test values into it. Say you pass it 5, base 10:

5 / 10 = 0.5 = 0 (int)
"0123456789abcdef"[0 % 10] = '0'
Well damn. ...
Forum: C++ Mar 5th, 2009
Replies: 6
Views: 688
Posted By skatamatic
I don't understand why your are interchanging null terminated c style strings with the String class. The string class alone should suffice here and it handles its own memory (and also contains an...
Forum: C++ Mar 2nd, 2009
Replies: 18
Solved: PLS. READ
Views: 684
Posted By skatamatic
Hey thrashing the thrashers is just as hypocritical as hating all racists.
Forum: C++ Mar 2nd, 2009
Replies: 18
Solved: PLS. READ
Views: 684
Posted By skatamatic
Use a for loop. And show some freakin effort!
Forum: C++ Jan 20th, 2009
Replies: 4
Views: 1,096
Posted By skatamatic
It's easiest to read it from right to left. int const * const reads constand pointer to constant integer. Meaning the pointer value won't change, and the pointed to value won't change. No effect...
Forum: C++ Jan 19th, 2009
Replies: 14
Views: 762
Posted By skatamatic
Unless its an RTTI assignment, you probably shouldn't use it. Use the method I described earlier.
Forum: C++ Jan 19th, 2009
Replies: 6
Views: 1,301
Posted By skatamatic
Hard to tell when you don't show us the context in which they are used.
Forum: C++ Jan 19th, 2009
Replies: 14
Views: 762
Posted By skatamatic
If you have to use RTTI as part of the assignment, then google it. Otherwise do as the others sugguested. Implement in the base class (the one you derived the 2 accounts from?) a virtual method...
Forum: C++ Jan 19th, 2009
Replies: 4
Views: 1,912
Posted By skatamatic
What they are trying to say is, it's bad practice to exit your program spontaneously. Objects would be left undestroyed, memory orphaned, and it just doesn't look professional. Instead, use logical...
Forum: C++ Jan 19th, 2009
Replies: 4
Views: 1,096
Posted By skatamatic
I don't think that would help the performance. If anything, it would just increase build time by about a few clock cycles (setting a const flag). If you actually broke down the code you write into...
Forum: C++ Jan 10th, 2009
Replies: 9
Views: 760
Posted By skatamatic
You can load the files in using the fstream.


ifstream inFile;
vector<string> data;
inFile.open("File.txt");
while (!inFile.eof())
{
string sString = inFile.getline();
...
Forum: C++ Jan 9th, 2009
Replies: 2
Views: 520
Posted By skatamatic
Your map code seems fine. Maybe post more code, where s and v are declared. It seems like this wasn't copied and pasted, since there's a few program-busting spelling mistakes in it. You might...
Forum: C++ Jan 9th, 2009
Replies: 9
Views: 760
Posted By skatamatic
As for the actual problem, I would go with a simpler method. Simply push all the keywords into a vector of strings, then load in the file to check against (a txt file) into another vector of...
Forum: C++ Jan 9th, 2009
Replies: 9
Views: 760
Posted By skatamatic
If you are using VS2005+ press ctrl+a+k then f. This will run a macro to format all of your indents perfectly =)
Forum: C++ Jan 6th, 2009
Replies: 11
Views: 1,042
Posted By skatamatic
How about...don't read the file twice!! It's practices like this that cause execssive wear on harddrives. Why not load everything in the file into memory (an array/vector)? You will find that RAM...
Forum: C++ Jan 6th, 2009
Replies: 7
Views: 809
Posted By skatamatic
This is just semantics. It doesn't matter at all. In fact, it's faster to make them all members (from a coders perspective) since you need one less argument per operator.
Forum: C++ Jan 6th, 2009
Replies: 7
Views: 809
Posted By skatamatic
The reason for using const modifiers is for situations like this:

Point const X(5, 2, 3);
Point Y(0, 0, 0);
Y = X;

Since x is a const, the previous version of your code will not work, but the...
Forum: C++ Nov 14th, 2008
Replies: 15
Views: 816
Posted By skatamatic
here's what i used to test it:

#include "NumberList.h"
#include<iostream>
using namespace std;

int main()
{
NumberList mylist;
cout<<"Adding 5..."<<endl;
Forum: C++ Nov 14th, 2008
Replies: 15
Views: 816
Posted By skatamatic
Well it's up to you, really. Taking out the - 1 in the while loop will adjust it to what you want.
Forum: C++ Nov 14th, 2008
Replies: 15
Views: 816
Posted By skatamatic
This seems to be working fine... I made a list of 5, 10, 20, 30, and then insertedbypostion @ 2, and got the list 5, 2, 10, 20 , 30. Isn't this what you want?
Forum: C++ Nov 14th, 2008
Replies: 15
Views: 816
Posted By skatamatic
Arrg I'll compile it and see what I can find out for you :P. Post the whole code (or better yet attach a zip of the whole project)
Forum: C++ Nov 14th, 2008
Replies: 15
Views: 816
Posted By skatamatic
The position should still be -1, so in the while loop, use

while (nodePtr !=0 && position < pos - 1)


also, init position to 0, not 1
Forum: C++ Nov 14th, 2008
Replies: 15
Views: 816
Posted By skatamatic
I think the if(pos <= 1) should be if(pos < 1), since 0 is the head.
Forum: C++ Nov 14th, 2008
Replies: 15
Views: 816
Posted By skatamatic
Hmmm perhaps you should be comparing to position - 1, since 0 is counted. While something may be in 3rd in the list, it would be counted as 2nd since position starts at 0. Position will always...
Forum: C++ Nov 2nd, 2008
Replies: 14
Views: 836
Posted By skatamatic
At a glance I saw more than 15 syntax errors. I'm way too lazy to point those all out... you have [] around a cout statement - that would probably make a compiler explode. You have ; all over the...
Forum: C++ Nov 2nd, 2008
Replies: 4
Views: 411
Posted By skatamatic
remember that an array's max index is always 1 less than its size, since 0 is included. So for part 1,

numberArray[0][0] = 148;

and #2

numberArray [8][10] = 18;
Forum: C++ Nov 2nd, 2008
Replies: 6
Views: 483
Posted By skatamatic
Hmmm I think using chars should be fine. Post the whole program and I'll race you to debug it.
Forum: C++ Nov 2nd, 2008
Replies: 3
Views: 469
Posted By skatamatic
int list::recursion(int item, int position, node * temp = startPtr)
{
if (temp->next)
{
if(temp->item != item)
recursion(iItem,...
Forum: C++ Nov 2nd, 2008
Replies: 6
Views: 483
Posted By skatamatic
For problems like this, I would step through the code (via F10 to step through and F11 to step 'in' in VC++). Keep an eye on your local variable list, and as their values change make sure that they...
Forum: C++ Oct 29th, 2008
Replies: 21
Views: 1,479
Posted By skatamatic
I'd recommend you either #ifdef #define something at the start of your .h file, or use a #pragma once line to ensure it isn't being included multiple times.
Forum: C++ Oct 27th, 2008
Replies: 2
Views: 362
Posted By skatamatic
I don't understand your for loop (which is also syntactically erronous) , or the do loop. Just get rid of them for now, and implement them later if need be.

Hmm you are using the switch syntax...
Forum: C++ Oct 27th, 2008
Replies: 5
Solved: pointer problem
Views: 446
Posted By skatamatic
I suppose if you were writing software for something with very little available memory (ie a cell phone), it could become a problem. But now I'm just getting off topic.
Forum: C++ Oct 27th, 2008
Replies: 5
Solved: pointer problem
Views: 446
Posted By skatamatic
Also, checking to see if the pointer is NULL is a method of checking if the memory was actually allocated. But an exception will halt the execution before this can be checked, so the nothrow arg...
Forum: C++ Oct 27th, 2008
Replies: 5
Solved: pointer problem
Views: 446
Posted By skatamatic
Hmmm. Maybe you should include the code to make the program run? Also, I would sugguest using inheritance rather than unions for this (like ancient dragon said). Here's the drawer header my school...
Forum: C++ Oct 25th, 2008
Replies: 8
Views: 464
Posted By skatamatic
Hmmm i never realised that the class only represents 1 toy. Ignore the part I said about arrays, but still fix the recursion issue.
Showing results 1 to 40 of 66

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC