>>Does my second header have to be a pointer too or can it be static?
No, it does not need to be a pointer. what you have on line 14 of class example2 looks ok to me.
>>Does my second header have to be a pointer too or can it be static?
No, it does not need to be a pointer. what you have on line 14 of class example2 looks ok to me.
I think that is beyond the scope of VC. Get an installation program, something like InstallShield should do it.
create an OnTimer() event handler that updates the box.
I just visited DaniWeb without being logged in and saw that popup window. Looks pretty darned good to me :) There are lots of other advertisements that bother me more than that popup.
Are you sure about that 2,000/day? I have been here almost 4 years, and at that rate there should have been nearly 3,000,000 new members! On the otherhand it probably hasn't been 4 years since you started doing that.
you can use the macro toupper() to convert a character to upper case. If you have a whole string to convert then create a loop and convert each charcter
string str = "hello world";
for(int i = 0; i < str.length(); i++)
str[i] = toupper(str[i]);
In c++, an even easier way is to use the c++ transform() function
#include <alborithm>
#include <string>
using namespace std;
int main()
{
string str = "hello world";
transform(str.begin(), str.end(), str.begin(), tupper);
}
WUT? :confused:
gotdam theres a lot of misinformation being thrown around in this thread
i wish some of you people would go take a biology class or something
it's kind of embarrassing.
Where is the mis-information? Humans are omnivores animals (yes, we are in the animal kingdom).
About the claim that plants have feelings -- I believe that about as much as I did the researchers who claimed a direct correlation between rising moon and pregnancy.
you are compiling for UNICODE, so param1 should be L"%d"
to force the conversion of the string to wchar_t*. Or it might be preferable to use _TEXT("%d")
so that you can turn off UNICODE if you want to and not have to change that line.
you did't include "F:\SDL-1.2.13\include\SDL.h in that zip file.
FiltroPNM::ApplyPixMap() has a lot of conversion problems -- converting int to float.
media = ( F_img_pix[i].rgb[0] + F_img_pix[i].rgb[1] + F_img_pix[i].rgb[2]) * 0.33333;
F_img_pix[i].rgb[0] = media;//transform red
F_img_pix[i].rgb[1] = media;//transform green
F_img_pix[i].rgb[2] = media;//transform blue
All those lines produce warnings which need to be fixed. And there are lots more similar problems all throughout that *.cpp code.
That's pretty much it in a nutshell. If you want to know exact details than I suppose you need to go to amazon.com and buy a book.
line 56: initialize variable i to 0.
line 75: fgets() adds the '\n' to the end of each line when '\n' appears in the data file. I don't know off-hand it that will cause problems for getaddrinfo() or not. You might add code between lines 57 and 58 to strip off '\n', and see if that fixed your problem.
As for buff -- I don't see how that could be the problem.
Ancient, even then it's wrong, file is a char pointer.
That was the whole point -- its supposed to be FILE*, not char*
use "%-4d" to left-justify the number in the field. Probably what you are seeing is the number right-justified.
>> fgets (mystring, 100, &file);
That's wrong -- remove the & symbol
int main(int argc, char* argv[])
{
char line[255];
FILE* fp;
if( argc == 1)
fp = fopen(argv[1], "r");
else
fp = fopen ("myfile.txt", "r");
while( fgets( line, sizeof(line), fp) != NULL)
{
printf("%s", line);
}
fclose(fp);
}
you need to use CString's Format() method. It works exactly like printf().
CString txt;
txt.Format("%d", m_AMC.get_FramesDrawn()));
MessageBox(txt, MB_OK);
what operating system? Dynamic C -- never heard of it.
how are you posting here?
You could reinstall the operating system, which will reinstall the IE browser.
>>How do I get another browser on my computer?
Go to the web site and download it ???
Oh I see. Thanks Dani.
The problem is the constructor with the parameter. It also needs to initialize instance variables because the constructor with no parameters does not get called.
You need to use function prototypes
void run(); // this is a function prototype
void command( const char* cmd); // another function prototype
int main()
{
run();
}
void run()
{
"code"
}
I have a bunch of old attachments I want to delete. Some of them have selections squares on the right side of the list while many do not. How do I delete those that can not be selected ?
The nice smiley face animation gets shown once. The vile south park animation gets shown three times on this page :P
Maybe because I uploaded it three times :-/
a 2d vector vector< vector<string> > lists;
Oh I get it now! Thanks.
getline() read an entire text line into the buffer. get() just read unformatted data, such as binary or text data.
There are two versions of getline() -- one for character arrays and the other for std::string.
std::string line;
char ln[255];
// character arrays
cin.getline( ln, sizeof(ln) );
//
// std::string
getline( cin, line );
hello all , i have to initialize the array of stucture singleIMEIarr to null , using NULL doesnt work , when i assign {'\0'} it doesnt execute. any suggestions at to where im wrong ?
struct singleIMEI { string planname; string plandescription; string scriptexec; string startdate; string starttime; string stopdate; string stoptime; string delayinterval; string repeatdelay; string notonweekend; string activate; string temptime; string tempdate; }; //VECTOR IMPLEMENTATION PENDING singleIMEI singleIMEIarr[30] = {'\0'};
You don't have to do that at all because std::string class will automatically create empty string when initially declared. If you want to re-initialize the structure to empty strings after it has been used, such as in a loop, then create an initializer method for that structure, something like below. In the loop your program just calls initialize() method to reinitiailze the structure.
struct singleIMEI
{
string planname;
string plandescription;
string scriptexec;
string startdate;
string starttime;
string stopdate;
string stoptime;
string delayinterval;
string repeatdelay;
string notonweekend;
string activate;
string temptime;
string tempdate;
singleIMEI() { intialize(); }
void initialize()
{
planname = "";
plandescription = "";
// etc. etc for each string
}
}; //VECTOR IMPLEMENTATION PENDING
string::npos is what the std::string.find() method returns when the search string is not found. Read about it in the documentation for the string class.
replace() will replace one instance of a character or string of characters with another. However, for a single character its just as easy to replace the character yourself. y[found] = 'x';
So are you saying you just made up those numbers? You need to post some actual rows out of a real file.
The way I understand it, the first number is a cell number, second through fourth numbers are door numbers (three doors) and the value of the numbers indicate the cell number that the doors open to. If that is true then a cell is a square with only three doors, or only two doors when one of the door numbers is -1.
If the first number is a cell number why are there duplicates ?
>>and says that door 1 leads to cell 1
There is no 1 on line 2. 0 2 3 4
while(found!=-1)
{
found=y.find(x,ind);
ind=found+1;
if(found==-1)
{break;}
The above can be better written like this because it doesn't require so much code and if statements.
while( (fund = y.find(x,ind)) != string::npos )
{
ind=found+1;
// etc etc
}
It would be helpful to know what those numbers mean.
my best guess is Pascal.
I'm using FF version 3.0.2 on 64-bit Vista. Every once in awhile it will just simply crash. I can restart and it will take me back to where it was when it crashed. Anyone know why it does that?
Ok, so how do I get that number? I uploaded the gif but did not see an attachment number.
If those are the only command-line options why do you need Boost? That's like swatting a fly with a sludge hammer.
post a link to the thread that this should have been an answer to and I'll fix it up for you. I can't tell what thread you were trying to answer.
If you have variables a, b and c it would be not too difficult with some if statements. But the more variables you have the greater difficulty to sort them without an array or linked list.
For example, I would consider an item with 500 voters and 4,6 rating better than one with 50 voters and a rating average of 4,8 but with the common algorithm the second would be considered better (if the voter cutoff limit is lower than 50 of course).
Statistically one may be a lot better than the other. You could calculate the standard deviation and error percentage.
yes but what is 9767?
[attach]9767[/attach]
I tried this and it doesn't work either
[attach]http://www.gifmania.co.uk/South-Park/Stan/Vomiting/[/attach]
Is it possible to add animated gif files to posts? I have tried [img] [/img] but it doesn't work. I've also tried to upload a gif file using the URL option, but that fails too.
Pickled Pigs Feet -- Yuuk!
Opti-World has been extremely successful recently. The addition of this it strengthens your position in some of the fastest-growing segments of the business.
Get great ideas about your sales and marketing strategy, include information on how the product or service will be priced. There are lots of channels to market and to advertise our marketing plans.
Can't you find something new to post about? This thread is 5 years old now.
Try GetVersionEx Windows API function.
See MSDN article(s): http://msdn.microsoft.com/en-us/library/ms724451(VS.85).aspx
Agree -- that provides more info than the registry link I posted.
First, read all the words in keywords.txt into a string array or vector.vector<string> keywords
line.replace(pos, keyword[i].length(), keyword[i]
Its in the registry HKLM\Software\Microsoft\Windows NT\Product Name
size_t is defined as unsigned int by Microsoft compilers and I think also by gcc. Assigning -1 to unsigned int should probably be considered undefined behavior since unsigned int can not hold a negative value.
I'm not sure I understand the format of the *.txt file. Will you post an example file?
And the keyword file. What does it look like -- post sample lines from that file.
>>I am new to programming, what does this code actually do? Where would I put it?
You are trying too hard. It's a lot simpler than what you posted.
Every character has an ascii value associated with it. See an ascii chart for the values. Internally, a C or C++ program does not know a thing about the letters 'A', 'B', etc. only numeric ascii values shown in that chart. When you type 'A' with your keyboard you are really seeing the ascii numeric value converted to a graphic that is displayed in the font you have selected. That's why an 'A' may look differently with each font you choose. Behinds the scens an 'A' is 65 regardless of the font.
You will understand this better if you write a short program that displays all the characters of the alphabet.
#include <iostream>
using namespace std;
int main()
{
for(char i = 'A'; i < 'Z'; i++)
{
cout << i << " = " << (int)i << "\n";
}
for(char i = 'a'; i < 'z'; i++)
{
cout << i << " = " << (int)i << "\n";
}
}
For the purpose of your assignment, just prompt for two characters then display their ascii values as illustrated in the above program. It's really no more difficult than that.