- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Olde programmer - Pascal, Basic, Perl but new to C++
23 Posted Topics
This is a snippet from a larger block of code. The print statements are included for testing. Within 'main', if I ouput the 'cell_ptr' or 'params' pointers, it correctly returns pointer values but if I try to output an element from the params array, I get an '...illegal operation...' message. … | |
[code] #include <iostream> #include <string> using namespace std; struct record { string C0; string C1; string C2; }; int main() { record param; param.C0 = "heading1"; param.C1 = "heading2"; param.C2 = "heading3"; string key = "CO"; string data = param.C0; cout << "DATA: " << data << endl; return 1; … | |
Re: [QUOTE=nsan]some easy questions about c++ 1. is it possible to link the c++ files with databases like oracle,MySql? (coding the file to access the databases) 2. can we put the compiled files on websites? Google.com is build in C and C++ and their search engine is running on that. how … ![]() | |
Re: [QUOTE=almared_6]ya that's ok with me, but how do I get a record with the smallest? That's the question that I'm trying to find an answer for.[/QUOTE] Get first entry and put it in a variable 'smallest' qty = 0; // why zero here and not at the beginning? food for … | |
Re: [i]>> NOPE NOT BROKEN I DONT CARE IF I USE CORRECT GRAMER ONLINE AS LONG AS IT GETS THERE....[/i] And statements like this will not bring you much help, either. | |
Re: I don't know exactly what your professor gave you, but the code you have is probably not going to get you where you want to go. You don't really need the 'findNode' or 'getRoot' functions (methods). Here's some commented code that should get you started on the right track. [code] … | |
Re: [i]n = k*3;[/i] In this line, what are the values of n and k ? Did you put that line in the right place? | |
Re: A Classic example of where to use pseudo code.... see discussion at [url]http://www.daniweb.com/techtalkforums/thread41482.html[/url] [code] PSEUDO CODE // Input file names => code here // define an array to accumulate results => code here // in a loop, Read input file, line by line => code here // Extract the various … | |
Re: Perhaps a little nudge in a slightly different direction. Specify the problem in sudo code - and don't worry about actual code yet. This applies to any computer program in any language. Remember, in C and C++, you must declare a variable before using it. ( Well actually you can … | |
Re: This assumes that, if the list already exist, it is in 'name' order [code] ... temp->next = NULL; // add this to temp just after cin curr = head; if (curr == NULL) // empty list { head = temp; } else { while (curr != NULL) { if (curr->next … | |
In CApplView I create a Login Form. [code] void CApplView::Login_Entry(CDC *pDC) { .. if (pUserid == NULL) { pUserid = new CEdit; pUserid->Create(WS_CHILD|WS_VISIBLE|WS_BORDER, CRect(x,y1,w,h), this, IDC_USER); pPasswd = new CEdit; pPasswd->Create(WS_CHILD|WS_VISIBLE|WS_BORDER, CRect(x,y2,w,h), this, IDC_PASS); pbLogin = new CButton(); pbLogin->Create("Login",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, CRect(x,y3,w,h), this, IDB_LOGIN); } } [/code] How do I add code … | |
Re: [code] std::string s1="HelloWorld"; if(s1.find("World",0) != std::string.npos) { printf("found"); } else { printf("not there"); } [/code] | |
I'm attempting to build a simple listener, preferably without a Thread, but I am lost. I have a working listener in 'console' mode but I need one that works with MFC. It should stay open indefinately - (until I send a shutdown message) This is my initial non-working attempt. It … | |
Re: [code] int main() { do { ... your code ... } while (not some exit condition); return 0; } OR int main() { while (1) { ... your code ... if (some exit condition) { break; } } return 0; } [/code] | |
Re: [QUOTE=Lerner]This is going to involve a lot of shifting of values stored in the array.....[/QUOTE] Or you could use a linked list. | |
Re: Try something like this.... [code] <<sudocode>> first = true; In a for loop, using the char array... if (first) { build a string of chars in 'temp1' until there is a space and set first = false; } then build a string in 'temp2' until space. now compare temp1 to … | |
Re: [QUOTE=sosy2001]i dont understand[/QUOTE] Do you know what 'pass a parameter' means? [code] //If you have this function... int printGrade(int grade) { if ( grade >= 90) { ... } } // 'grade' is a parameter that is passed into the function. int main () { ... printGrade(23); ... } // … | |
I have limited experience with Object Oriented coding but not programming in general. Here is a stripped down version of my code. What I'm trying to do is set a variable declared in 'CProjectView::Handler' using a function in 'CtestClass'. Simple enough! but not for me. In the code as shown, … | |
Re: This is a good read.... [url]http://tangentsoft.net/wskfaq/[/url] | |
Re: Linked list are typically used to work with data structures. Access to items in the list is controlled by pointers. This is a very simple example to construct a linked list. You will need to do a lot more reading to use them correctly. One thing to remember: You must … | |
Re: Ancient Dragon... I'm also new to C++. Could you expand on a couple of items in your response.. [i]...the program sets all elements of the rolls array to 0 (there is a much easier way to do that than is shown in the program.)[/i]. How? [i]Finally, the program attempts (incorrectly … | |
I'm really new to C++, but not to programming, and don't really know what I'm doing. I had a bunch of programs working OK. Then I was messing with a window application and all my window programs would no longer compile. I get the following error (same for all projects) … |
The End.