Search:
Type: Posts; User: NeilH
Search:
Search took 0.03 seconds.
-
April 9th, 2004, 02:44 AM
If you know another language it prolly won't take you too long. I would say 3-4 months if you already know Java.... It took me a couple of years to get a decent knowledge of c++, but that was on and...
-
April 8th, 2004, 09:35 AM
A simple way would be to use the clock() function: http://www.cppreference.com/stddate_details.html#clock
int nStart = clock() / CLOCKS_PER_SECOND;
//Execute code to time here
int nTime =...
-
April 8th, 2004, 09:03 AM
You could clear the screen using
#include <iostream>
using namespace std;
//..
void main()
{
//..
-
April 8th, 2004, 08:38 AM
If the user will be modifying the shapes it's so much better to store the shapes as vectors (i.e. by storing the co-ordinates of the vertices).
Having said that, it is easy enough to apply...
-
April 8th, 2004, 08:33 AM
Use gluCylinder() to draw the cylinder, then apply the picture as a texture. If you want a full cylinder use gluDisk() to draw the disks on the ends.
...
-
April 6th, 2004, 11:18 AM
Use
unsigned char m = (unsigned char)x;
for 0-255 range...
The data format in the P5 data files is dictacted by the headers. The P5 data is just a sequence of bytes; sequences of either 2 or 1...
-
April 6th, 2004, 06:47 AM
A quick search on Google brings up
http://netpbm.sourceforge.net/doc/pgm.html
According to that, P2 is a text version, whereas P5 is a raw binary data. If you want to perform the conversion from...
-
April 6th, 2004, 06:19 AM
If you have an integer which is four bytes long, and you do
x & 255
You are effectively stripping off the last three bytes and hence losing that data. And yes, that means that there is no way...
-
April 5th, 2004, 08:52 AM
-
March 30th, 2004, 10:19 AM
I'm a terrible programmer, you don't have to tell me. I was demonstrating why his error was occuring, and not re-writing his program...
-
March 30th, 2004, 10:13 AM
tempSize=strlen(tempS);
should be
tempSize = strlen(tempS.c_str());
because strlen parameter asks for a character array, not a string object...
-
March 30th, 2004, 09:19 AM
Use cin.get() in a loop to retrieve the characters one after the other from the user. When you are satisfied that the sentence is complete (eg. when the user type a particular character) break out of...
-
March 30th, 2004, 09:16 AM
Global variables are a lazy programmers shortcut... As long as you don't define vast amounts of global variables you should be ok; it's not like a globally declared integer is going to cause harm
-
March 30th, 2004, 09:12 AM
#include <iostream>
#include <vector>
using namespace std;
void main()
{
vector<char> myVector; //Create the vector
myVector.push_back('h'); //Push an item onto the back
-
March 28th, 2004, 02:53 PM
If you want to do it your way, you don't need the header file "somefile.h", you can simply put:
extern unsigned char SomeFunc();
at the top of the file that is to use the function...
The...
-
March 28th, 2004, 12:19 PM
int nConverted = atoi(cStr.c_str());
You needed to pass the actual string buffer and not the string object...
-
March 24th, 2004, 05:28 PM
You won't learn by getting us to do it for you :)
-
March 21st, 2004, 09:22 AM
Or if you want to stick to the C way of doing it, use:
strcpy(newFileText, buffer);
You will have to make sure the size of newFileText is large enough to hold whats in buffer....
-
March 20th, 2004, 06:56 AM
Yeah I should have stated that. The problem was because strtok doesn't like const char* as a search string since it modifies it.
Thanks anyway tho
-
March 20th, 2004, 03:04 AM
I'm getting some very strange behaviour with strtok. I have a function containing this code:
char* token = strtok(strFilter, " ,"); //Tokenize the filter string (comma separated list)
...
-
September 12th, 2002, 05:00 AM
You need:
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
This tells the dialog that it's to handle docking toolbars. Just setting the toolbar to be dockable isn't enough.
...
-
July 16th, 2002, 06:19 PM
Bobwilson has posted some pretty decent stuff, helping a lot of people out. Just because he's said one "naughty" word doesn't make him all big and bad!
The point of these forums is to help people...
-
July 13th, 2002, 06:11 PM
int nBytes;
while(nBytes = File->Read(pszBuffer, 512))
{
//Do something with the buffer here
}
That will read in 512 characters at a time. Read returns the amount of bytes read, so will...
-
July 13th, 2002, 05:57 PM
char x = 4;
int y = (int) x;
Should work.
-
Call ShowWindow(SW_HIDE) on all toolbars. Then when you want to make them visible, ShowWindow(SW_SHOW).
//Hide the toolbar
m_ToolBar.ShowWindow(SW_HIDE);
//..
//Re-show it...
|
Click Here to Expand Forum to Full Width
|