Way back when...quzah wrote:
for( x = 0; mdarray[x][0]; x++ )
foo( array[x] );
return 0;
was array[x] supposed to be mdarray[x]?
Type: Posts; User: Dave++
Way back when...quzah wrote:
for( x = 0; mdarray[x][0]; x++ )
foo( array[x] );
return 0;
was array[x] supposed to be mdarray[x]?
> I am also free to choose a language and so decided for C++, because I want to collect some experience with it...
Wow, I was there once...
Consider creating some classes that contain things...
Why isn't this working...?
Yes, I am trying to force signed into unsigned.
By dereferencing the LHS I hope to accomplish the conversion.
It's the segmentation fault that concerns me.
I'm...
Hunter, when I first learned about "flowcharts" in third grade...I flowcharted everything. "How to sharpen a pencil" and even "How to take a c___". That was 1970. And so there sat a bunch of boxes...
I remember hearing from a friend about a math major where he worked and that when the math major discovered pointers he wrote a program with 13+ levels of indirection.
He kept complaining to his...
Brad,
What's your major in school? Have you seen Matrix Revolutions and its "the making of" on the companion CD?
After working as an engineer for 15 years I was depressed for half a year after...
My professor found an interesting site that discusses nanosleep and the accuracy of gettimeofday.
http://defectivecompass.wordpress.com/2006/09/01/high-precision-sleep/
code included
I'm doing C++ in Unix on a hardware effort, but I'll be using Java in Eclipse to develop cross platform apps from my MAC.
The cost in time and overhead to learn multiple IDE's and multiple...
You may be able to use the gettimeofday(...) function from within a script because its listed in the man pages. Then when the routine returns to the script you can hit the stop watch from within the...
This routine does it all...
It compares all the routines that are easily accessable.
Dave
Please, enter your name: dave
Hi dave.
dif: It took you 4.0 seconds to type your name.
Yes.............the compiler complained too ! :p
My problem is that one timer only resolves in seconds at a system level and the other at a cpu level. Therefore I can't really use either timer if I'm doing mid-freq DAQ sampling where CPU time can't...
Mike,
I've been working with the time and clock functions this past couple days and was glad to see this thread. I seem to have found lots of ways to keep it from working and I'll post some...
DWKS, Raigne,
Thanks for the updates. I'll be using them.
Dave
Alright, thanks for the code examples above.
I will be studying them and will use them once I know and test them better.
Below is the hardway in that it demonstrates the math and could be...
It's the code from Mike
http://cboard.cprogramming.com/showthread.php?t=90911
I modified to return std::string
std::string strOut = std::string(str); // using Daved approach as shown...
MacGyver,
Can you expand on your previous comment?
More testing...
In gdb I can comment out the call to the function, with a simple default value in its place, and then reset the DAQ...
On a related note:
I am converting a number to a string and would like to code...
std::string DecToBin(int num);
...
messageOut = "header 1: " + DecToBin(num);
And for the last hour...
The examples for C++ (unlike those for c stings) hide the use of pointers which lead me to above usage (even at the link given).
But clearly the link you gave shows that the arguments (even if...
Why would the following give an error as shown?
std::string messageOut = "header 1: " + "test";
error: invalid operands of types `const char[11]' and `const char[5]' to binary `operator+'
...
> but originally it is a bitwise operator
Thanks to all.
Mike,
Thanks for the code. I ran it on my end with no problems and it will integrate well into my application.
dave.thanks(10^6);
PS: found an error...won't work for zero :(
So added this at...
Also,
This code...could it be made to work with integers easily?
I am trying to go from an integer to binary to a string.
...
What is the best way to implement IOTA in CPP ? Using CPP Standards?
Given the following...I'd like to return a character version of a library call.
std::string...
FYI - if you think of each line as a column, it helps in organizing code layout.
fout << dec << "Item: ";
fout.width(3); fout << left << j << " Counts: ";
...