1,174 Posted Topics

Member Avatar for nelsonsu

[code]if(packe[q].strinput[0] == ' ') { q++; // Because you have incremented q by one, // the fprintf() call below is guaranteed to produce // unwanted output ... } // You must change your code so that you know whether to use // packe[q].strinput or packe[q - 1].strinput ... fprintf(creafile, "%d …

Member Avatar for nelsonsu
0
261
Member Avatar for henpecked1

At least one semicolon seems to be missing ... [code]int threedice::getsumFaces() { return die1.getroll()+die2.getroll()+die3.getroll() [B][COLOR="Red"];[/COLOR][/B] }[/code]

Member Avatar for vmanes
0
310
Member Avatar for Crushyerbones

You might also make use of the strstr() function [url]http://www.cplusplus.com/reference/clibrary/cstring/strstr.html[/url]

Member Avatar for Crushyerbones
0
122
Member Avatar for piyush_chande

[QUOTE=piyush_chande;564429]Hello!! I am using Keil Compiler C166. I want to know how much ROM, RAM has been utilized by the code. Can someone help me for this?[/QUOTE] Look into the produced listing file (.LST).

Member Avatar for Salem
0
63
Member Avatar for Jennifer84

[code]if( one == 'o' && two == 'l' && three == 'l' && four == 'e' && five == 'h' ) { [COLOR="Green"] // Select only as many characters as in string 'hello' // i.e. [B]five[/B] ...[/COLOR] this->richTextBox1->Select((positionen - 5), [B][COLOR="Green"]5[/COLOR][/B]); this->richTextBox1->SelectionColor = Color::Red; MessageBox::Show(this->richTextBox1->SelectedText); } [/code]

Member Avatar for Jennifer84
0
84
Member Avatar for nelsonsu

You are misusing fscanf() to scan the integers, you need to apply the address-of operator & [code] for(int i=0; i<max_terms;i++) { fscanf(finput,"%d", [B][COLOR="Red"]&[/COLOR][/B]timeslot1[i]); fgets(packe[q].strinput, 32, finput); if(packe[q].strinput[0]!='\n') q++; fscanf(fcommand,"%d", [B][COLOR="Red"]&[/COLOR][/B]timeslot2[i]); fgets(comm[i].strcommand, 24, fcommand); [COLOR="Green"] // Note that you may have incremented q by one, above, // whenever that is the …

Member Avatar for nelsonsu
0
157
Member Avatar for dolphin.rise

Bjarne Stroustrup's comments on the void main() -subject can be read here ... [url]http://www.research.att.com/~bs/bs_faq2.html#void-main[/url]

Member Avatar for mitrmkar
0
273
Member Avatar for Jennifer84

[QUOTE=Jennifer84;565642] Am I on the right track or have I missed something. [/QUOTE] You have now missed something, you are trying to access the KeyCode in wrong handler (TextChanged). Instead, for e.g. the KeyUp event, use ... [code] private: System::Void textBox1_KeyUp(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e) { if(Keys::C == e->KeyCode) { // …

Member Avatar for Jennifer84
0
102
Member Avatar for TylerTCF

Use the < operator instead of <= in both of your for loops, i.e. [CODE] for(i= 0; i < Sensor.size(); i++) { for (j=0; j < Observations.size(); j++) { } [/CODE]

Member Avatar for mitrmkar
0
125
Member Avatar for Traicey

Just pointing out the fact that in C/C++, array indexes are zero-based. A simple example [code]#define NUM_ELEMENTS 3 int Quantity[NUM_ELEMENTS]; // An array of three integers // Assign a value to each element Quantity[0] = 123; Quantity[1] = 456; Quantity[2] = 789; // Now, to output all elements, last valid …

Member Avatar for Traicey
0
103
Member Avatar for LindaWiklund

Could it be that you have not escaped backslashes in your string? I.e. in your code the string should be: [code] const char regex[] = "^\\[\\d{4}\\-\\d{2}\\-\\d{2}\\s\\d{2}\\:\\d{2}\\:\\d{2}\\.\\d{3}\\]\\s\\w*\\s*\\w*\\.+\\w*\\:\\d{4}\\sHello" [/code]

Member Avatar for LindaWiklund
0
101
Member Avatar for kartouss

A link that D. Sinkula earlierly posted in this thread, [url]http://www.di-mgt.com.au/cryptopad.html[/url] maybe it went unnoticed by you ...

Member Avatar for kartouss
0
549
Member Avatar for Jennifer84

You can use the SelectionStart TextBox's property for that purpose. Also closely related is the SelectionLength i.e. how many characters the selection spans (if any). As an example, to place the cursor in front of the second character without selected text, you could use [code]textBox1->SelectionStart = 1; textBox1->SelectionLength = 0; …

Member Avatar for Jennifer84
0
103
Member Avatar for lAmoebal

Get the dependency walker from [url]http://www.dependencywalker.com/[/url] and see whether your program actually needs one or more .dlls that you are not aware of.

Member Avatar for Ancient Dragon
-1
236
Member Avatar for geska10

[QUOTE=jephthah;564354]LOL you kids, i swear how about you send me $500 to my PayPal account and I'll won't track your IP address and tell your teacher what you're up to..[/QUOTE] Hmmm ... your post could be moved to a blackmail forum, if one existed ...

Member Avatar for mitrmkar
0
86
Member Avatar for CoolGamer48

[QUOTE=CoolGamer48;564134]Um, what exactly does compiling it as release change[/QUOTE] The release version of your program requires a different set of .dlls to be present on the target system. What linker errors are you receiving?

Member Avatar for CoolGamer48
0
188
Member Avatar for Jennifer84

You need to do customized drawing for the Textbox. It can be difficult/complex to implement, depending on what you want to do. Anyhow, if you are interested, then look e.g. into [url]http://msdn2.microsoft.com/en-us/magazine/cc164019.aspx[/url]

Member Avatar for Jennifer84
0
111
Member Avatar for Petrock6

[QUOTE=Petrock6;563603] Well, how do I know and access the paremetters of this command? [/QUOTE] In general, look into the documentation of each of the functions that you are to use. If you installed MSDN along with VC 6, you already have a lots of documentation on your computer. On internet, …

Member Avatar for mitrmkar
0
112
Member Avatar for amitahlawat20

A short tutorial on pointers [url]http://www.cplusplus.com/doc/tutorial/pointers.html[/url] Also pointers to void (i.e. void *) are discussed there ...

Member Avatar for sahil_itprof
0
151
Member Avatar for -genESIS-

Maybe the following clarifies it [code]#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char** p = NULL; const int numStrings = 2; char string[21]; p = (char**)malloc(sizeof(char **) * numStrings); for(int nn = 0; nn < numStrings; ++ nn) { sprintf(string, "string %d\0", nn); p[nn] = (char*) malloc(strlen(string) + …

Member Avatar for jephthah
0
111
Member Avatar for kemarS

If you are referring to the MFC's CMap, then start by looking in here [url]http://msdn2.microsoft.com/en-us/library/s897094z(VS.80).aspx[/url] and perhaps here too [url]http://www.codeproject.com/KB/architecture/cmap_howto.aspx[/url]

Member Avatar for mitrmkar
0
109
Member Avatar for cbattagler

I'm not sure whether I fully understood your question, but consider the following program [code] #include <iostream> using namespace std; int main(int argc, char * argv[]) { if(2 == argc) { cout << "received: (" << argv[1] << ")" << endl; } return 0; }[/code] Let's say that the program …

Member Avatar for cbattagler
0
94
Member Avatar for technogeek_42

[QUOTE=technogeek_42;557417] i can't run this their is plenty of errors coz using namestd; is not available in My turbo C[/QUOTE] Just grab yourself an up-to-date, free development environment, for example [url]http://www.codeblocks.org/[/url] or [url]http://www.bloodshed.net/index.html[/url] or pick one from ... [url]http://www.bloodshed.net/compilers/index.html[/url]

Member Avatar for technogeek_42
0
723
Member Avatar for Jennifer84

[QUOTE=Jennifer84;561945] Is it not possible to find the next occurence of a character and then find("]") wich comes after the string stringToFind ?[/QUOTE] The find() function can be told where to start the search from, see below [code=cplusplus] string Line = "a4545l5l[12] 1Number2[51] 2Number[1]"; string stringToFind = "1Number2["; string::size_type startPos …

Member Avatar for Jennifer84
0
166
Member Avatar for guitarrick

Appears as if you were not having the corresponding .cpp included in scope of compile/link, i.e. the one in which you've implemented e.g. AppointmentBook::AppointmentBook() ...

Member Avatar for guitarrick
0
125
Member Avatar for Allen 0108

The bahaviour would perhaps be more understandable if written like [CODE]int main() { using namespace std; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cout << i << " " << j << endl; } } return 0; …

Member Avatar for Allen 0108
0
247
Member Avatar for digital_ice7

Then you could loop through the array and convert the ints one by one using something like [code]char_array[index] = int_array[index] + '0';[/code] In general, to convert any integer value to a std::string, you can use a stringstream: [code] stringstream sstream; string astring; int value = 213123; sstream << value; sstream …

Member Avatar for mitrmkar
0
107
Member Avatar for Yaka

Consider also that warnings often times should really be paid attention to, rather than trying to hide them ...

Member Avatar for mitrmkar
0
332
Member Avatar for henpecked1

About the punchmeinthehead() function ... [code] void punchmeinthehead() { const int maxin = 16; // Here you have three uninitialized arrays of char, use a // debugger to see what they contain here ... // (Shouldn't you instead be using the variables // that you have in your main() ?) …

Member Avatar for henpecked1
0
137
Member Avatar for LindaWiklund

This is a run-time problem rather than link-time problem (i.e. linker search path properties are of no help). Modify your computer's PATH environment variable to include the C:\glib-2.14.6\bin directory. You need to restart Eclipse in order for the change to take effect.

Member Avatar for mitrmkar
0
170
Member Avatar for Cosa

You need to have, e.g. [code]#define ADDRESS_LEN_MAX 123 char searchaddress[ADDRESS_LEN_MAX] = ""; char newaddress[ADDRESS_LEN_MAX] = "";[/code] or perhaps use std::string (with appropriate changes to the code) i.e. [code] std::string searchaddress; std::string newaddress;[/code]

Member Avatar for Cosa
0
285
Member Avatar for Crushyerbones
Member Avatar for jimJohnson

Hmm .. maybe you can get some ideas from the following... [code] #include <iostream> using namespace std; int main() { int height = 3; int width = 3; unsigned char fillSymbol = 0xf0; // draw a 3x3 area using fillSymbol while(height --) { for(int col = 0; col < width; …

Member Avatar for Lerner
0
545
Member Avatar for dan9992

This [code]if(buffer[posinstream] == [COLOR="Red"]"[/COLOR] [COLOR="Red"]"[/COLOR] || buffer[posinstream] == [COLOR="Red"]"[/COLOR]_[COLOR="Red"]"[/COLOR])[/code] should be [code]if(buffer[posinstream] == ' ' || buffer[posinstream] == '_')[/code]

Member Avatar for dan9992
0
84
Member Avatar for Xerema

In the last if, you need to change from [code]if(valinta2 == 1){ return valinta; }[/code] to [code]if(valinta2 == [B][COLOR="Green"]2[/COLOR][/B]){ return valinta; }[/code] You can do with one variable for getting the user's choice i.e. use only valinta and toss away valinta2 altogether. And also drop the needless else if block …

Member Avatar for samer.daur
0
98
Member Avatar for heidigjr

For starters, instead of [CODE] char *string1[100000], *string2[100000]; [/CODE] you'll be doing much better of with something like [code] #define MAX_STRING_LEN 123 // define some reasonable string length // 100000 really is not in that category, I think char string1[MAX_STRING_LEN] = ""; char string2[MAX_STRING_LEN] = ""; [/code] Then after you've …

Member Avatar for WaltP
0
100
Member Avatar for sanjayk1241@yah

[QUOTE=sanjayk1241@yah;558730] The above command is not satisfying my requirement. I don't which options i should use to get this.[/QUOTE] Hmm .. open a command prompt and try e.g. cpp32.exe -? to see if there is an option for preserving comments in the preprocessor output.

Member Avatar for mitrmkar
0
189
Member Avatar for Jennifer84

That will not work out-of-the-box, you should take a look at: stringize and the token-pasting operators e.g. here [url]http://www.keil.com/support/man/docs/c166/c166_pp_tokenpastingop.htm[/url]

Member Avatar for Jennifer84
0
390
Member Avatar for scream2ice

[QUOTE=scream2ice;558800] cin>>elem(i,j); //[B]this is the bit the compiler seems to give the error for [/B] [/QUOTE] The elem() function call is unncessary there, you can directly access the data member variable, i.e. cin >> data[the index here]. If you want to stick to using the elem() function call there, you …

Member Avatar for scream2ice
0
140
Member Avatar for langzhen

[QUOTE=langzhen;556139]our program won't compute[/QUOTE] At least two primitive problems, to fix, change: [code]scanf("%s", [COLOR="Red"]&[/COLOR]item);[/code] to [code]scanf("%s", item);[/code] and [code]scanf("%i",subtotal);[/code] to [code]scanf("%i", [B][COLOR="Green"]&[/COLOR][/B]subtotal);[/code]

Member Avatar for langzhen
0
119
Member Avatar for Jennifer84

A minor note .. why are you skipping the ReadInGroup[] at index 0? In your for loop, you start at index 1 instead of 0, so that leaves the first index of ReadInGroup[] unprocessed. Is that what you want, or should you change [code]for (int Starting = 1; Starting < …

Member Avatar for Jennifer84
0
120
Member Avatar for harishankarb

[QUOTE=harishankarb;557800]I mistook his caption(RonaldRegan Qoutes). [/QUOTE]:icon_cheesygrin:

Member Avatar for mitrmkar
0
102
Member Avatar for Jennifer84

You need to use the new_end iterator that the unique() produced. [code] std::sort(ReadInData.begin(), ReadInData.end()); vector<string>::iterator new_end = std::unique(ReadInData.begin(), ReadInData.end()); for (std::vector<string>::iterator it = ReadInData.begin(); it != [COLOR="Red"]new_end[/COLOR]; ++it) { outFile << *it << '\n'; } [/code]

Member Avatar for Jennifer84
0
346
Member Avatar for Gerritt

The following is not an assignment [code]n[count] [COLOR="Red"][B]==[/B][/COLOR] c; [/code] instead use [code]n[count] = c;[/code] Didn't your compiler complain about that line?

Member Avatar for jephthah
0
118
Member Avatar for rahul.b123

[QUOTE=rahul.b123;554426]my main interest is to learn to write virus[/QUOTE] Oh well, you really are on your own with that one ...

Member Avatar for DangerDev
0
93
Member Avatar for technogeek_42

[QUOTE=technogeek_42;544839]how can u convert the month-date-year to a day like monday?[/QUOTE] The complete answer to that question is already given in Dave Sinkula's post in this thread (see [url]http://www.daniweb.com/forums/thread109909.html[/url]). Look at closely the output of his program: [code] /* my output [B][COLOR="Green"]Tuesday[/COLOR][/B] Tue Feb 19 00:00:00 2008 */ [/code] The …

Member Avatar for technogeek_42
0
442
Member Avatar for Jennifer84

This should do [code]System::Diagnostics::Process::Start("c:\\test.txt");[/code]

Member Avatar for Jennifer84
0
92
Member Avatar for adnanius

You need to implement something like operator >= (const photon & other) in the photon class, so that the comparison can be made.

Member Avatar for adnanius
0
111
Member Avatar for Jennifer84

Have you tried .. to show the sub-form from the main form (which has to be a MDIContainer) [code]// remove the taskbar style from the main form this->ShowInTaskbar = false; SubForm.MdiParent = this; Subform.Show(); [/code] And when the sub-form closes, use ParentForm ... [code] // Restore the taskbar style of …

Member Avatar for Jennifer84
0
114
Member Avatar for dkwantee

[QUOTE=dkwantee;556141] i have been able to understand upto 7 line. can someone help me further?[/QUOTE] This might prove helpful ... [url]http://en.wikipedia.org/wiki/Selection_sort#Method[/url]

Member Avatar for manzoor
0
114

The End.