2,384 Posted Topics
Re: [QUOTE=dilip.mathews]Can we delete this pointer from a member function.[/QUOTE]It's worth a search, since this is a question that gets asked all the time. Sorry I didn't read much of the detail because of this. I'll just point at this and hope it answers your question. [url]http://www.parashift.com/c++-faq-lite/freestore-mgmt.html#faq-16.15[/url] | |
Some sites have the quoting by default, here it takes a little extra effort. But when it exists, nested quotes look a little odd. [post]218686[/post] | |
Re: Perhaps this may help a little: [url=http://www.daniweb.com/code/snippet262.html]Strings: Search and Replace[/url]. | |
Re: Learn how to post questions if you want to receive answers. A template: [quote]Hi, this all of my code. [code]/*... */[/code]This code gives me the following errors: [quote]errors[/quote][/quote]Piece parts and what not exacerbate things. Especially This Annoying Typing Convention. | |
In some forums, reputation works (marginally). Here it really doesn't. I think you need to bump newbie rep a bit to get the ball rolling. And I also think that giving rep in non-tech forums completely waters down the rep system. When done this way it really amounts to ass-kissing … | |
Re: I've made [url=http://www.daniweb.com/code/coder5020.html]a couple of contributions[/url], and I sometimes have a hard time finding something I know I've written. Yeah, it's partly laziness, but it takes me a wee bit to figure out convention and reconfigure my brain to find something I know is there... Something about the bubbly oranges … | |
Re: [QUOTE=Sashar400]Explain Please what these lines mean.[/QUOTE]Better still would be to take an initial guess to help others help you by at least having a frame of reference. But...[code]#include <iostream> using namespace std; int sum(int[],int);// [COLOR="Blue"](1) function declaration or prototype[/COLOR] int main() { int a[]={11,33,55,77};// [COLOR="Blue"](2) initialization of an array[/COLOR] int … | |
Re: FWIW: [url]http://parashift.com/c++-faq-lite/references.html#faq-8.1[/url] [quote]Important note: Even though a reference is often implemented using an address in the underlying assembly language, please do not think of a reference as a funny looking pointer to an object. A reference is the object. It is not a pointer to the object, nor a copy … | |
Re: Is this anything like you're trying to do? [code]#include <iostream> #include <string> using namespace std; bool foo(string &result, const string &Line) { static const string keystart("World:</TD><TD>"), keyend("</TD></TR>"); string::size_type start = Line.find(keystart); if ( start != string::npos ) { start += keystart.length(); string::size_type end = Line.find(keyend, start); if ( end != … | |
Re: [code]#include <iostream> #include <string> #include <cstring> using namespace std; int main() { string mystring="123456789"; std::cout << mystring.find("3",0) << '\n'; char *mychar="123456789"; // how do I find the position of "3"? char *found = strstr(mychar, "3"); std::cout << found - mychar << '\n'; return 0; } /* my output 2 2 … | |
Re: [QUOTE=mitchelltab]I'm having issues reading more then one line of data.[/QUOTE]Here is a template for doing so. [code]#include <stdio.h> int main() { static const char filename[] = "file.txt"; FILE *file = fopen(filename, "r"); if ( file != NULL ) { char line[32]; while ( fgets(line, sizeof line, file) != NULL ) … | |
Re: An installer (for Windows?)? [url]http://en.wikipedia.org/wiki/Windows_Installer[/url] | |
Re: If a character is a string, change it to an underscore. Later, rinse, repeat (if necessary). Post an attempt. Read the announcement in this forum if you need clarification of my last statement. | |
Re: With regard to question #2, that would be implementation specific. If you are not on a hosted system, I would imagine that you can at least name the platform, which may have its own specifics (and manuals) to query. | |
Re: You can initialize elements like that, but you are trying to assign them, which you cannot do. You can assign each member individually. | |
Re: If x is less than or equal to 5, y is set to 1 -- otherwise y is set to 0; x is then incremented. But better would be for you to ask, "I think that this statement does [...]. Is this correct?" Or at least provide a (minimal, but … | |
Re: How to ask a question about code:[list=1][*]Learn to use indentation. [*]Post the whole code that is your latest attempt. [*]Use code tags. [*]If there are error or warning messages, copy and paste them into the post. [*][I]Ask the question[/I], state what confuses you, etc.[/list]None of your attempts yet fit that … | |
Re: MSVC6? [I]cnt[/I] is udefined in several places using standard C++. Yet is seems to want to be C... [code]#include <stdio.h> #include <stdlib.h>[/code]Except for the [INLINECODE]malloc[/INLINECODE] casting:[code]int *array = [COLOR="Magenta"](int *)[/COLOR]malloc(sizeof(int) * total);[/code]I don't suppose you could post "data.txt" and specify which language you are using (God forbit the bastard C/C++!). | |
Re: I'm not a fan of [INLINECODE]strtok[/INLINECODE]. [url]http://www.daniweb.com/code/snippet318.html[/url] [url]http://www.daniweb.com/code/snippet281.html[/url] [url]http://www.daniweb.com/code/snippet443.htm[/url] [url]http://www.daniweb.com/code/snippet444.html[/url] | |
Re: My first LOL. Penis Land, The Rapist Finder, and Power Genitalia amuzed me most. | |
Re: [post=235794][COLOR="Magenta"]Creating Bruteforce Program[/COLOR][/post][QUOTE=portege][quote=iamthwee]You mean [COLOR="Magenta"]start up on every reboot[/COLOR]. And [COLOR="Magenta"]runs in the background[/COLOR]...[/quote] That would fit.[/QUOTE][QUOTE=portege]Ok, here's an example. To shutdown a computer using windows you can press ctrl+alt, u, u. If I wanted my computer to shutdown everytime I pressed u,u,u, how would I go about making a … | |
Re: [QUOTE=hollystyles]Take the first item in the array 0x08 we know from the 0x it's a hexidecimal number (base 8) [/quote]Hexadecimal is base 16 -- octal (base 8) has a leading zero, but not x or X. [QUOTE=hollystyles]Now table_1 is a pointer to the start of the array of numbers in … | |
Re: [code]if ( MONEY = 10000 )[/code]Perhaps you are inadvertently doing what you might not want to: = is assignment, == is comparison.[code]if ( MINE == 1 )[/code]Make sure MINE is assigned something in all branches before moving on. Perhaps initialize it on declaration. Also consider a switch statement instead of … | |
Re: [QUOTE=ostkaka]I started with a tutorial in C++ but I got stuck[/QUOTE]Post the code that you got stuck on, and ask your questions as clearly as you can state them. Lather, rinse, repeat (if necessary). | |
Re: I got doubles at 10:14am CDT. I've had other double and triples on and off for a while now. | |
Re: goto But a real code snippet would be helpful because 99% of the time you can use on of the other loop constructs. | |
Re: From the original post, I changed this: [code] for ( int i=0; i<20; i++ ) { [COLOR="Blue"]if ( strstr(data[i], search) ) { cout << data[i] << endl; incVar++; }[/COLOR] }[/code]Results:[quote]H:\>"Testpp.exe" Joe Smith, 555-324-5532 Mike Newman, 234-234-3686 Jennifer Meadow, 322-342-1252 Jonathan Peters, 383-123-4135 Laura Marino, 123-345-2341 Hanna Petersons, 678-123-3631 Jordan Gwent, … | |
Re: Assume string literals are nonmodifiable. Use a modifiable array. [code]char p[] = "name";[/code]And main returns an int. Are you just starting out and have a bad reference? | |
Re: [URL="http://forums.devshed.com/c-programming-42/error-in-reading-a-text-file-370553.html"][Other replies][/URL] I'd find it helpful if you posted a complete code rather than expecting me to flesh in everything. | |
Re: This forum is for C and C++ language questions. If you don't have a C or C++ question, perhaps one of the other forums may be more suited to posting your question. | |
Re: [QUOTE=wingwarp]what is a pointers use...[/QUOTE]You might start by asking a specific question rather than being so vague. A person could write a book to answer your question. [url=http://pw2.netcom.com/~tjensen/ptr/pointers.htm]A TUTORIAL ON POINTERS AND ARRAYS IN C[/url] Also, programmers eventually learn to clearly specify things and do so in plain English. You … | |
Re: [QUOTE=gurudatta.verma]i want to know abt Ellips arugument passing to any funtion[/QUOTE]Hmm. I think I finally may have a hint of what you are asking. [url]http://c-faq.com/varargs/index.html[/url] | |
Re: [QUOTE=Preity]I would be glad if u do da needful. Thank u[/QUOTE]Can you try saying that again in English? | |
Re: Announcement: [url=http://www.daniweb.com/techtalkforums/announcement8-2.html]We only give homework help to those who show effort[/url] Take a stab at writing some code. | |
Re: One [INLINECODE]cin.get()[/INLINECODE] grabs the leftover newline (which remains after entering a number), and a second [INLINECODE]cin.get()[/INLINECODE] will actually then wait for a keypress. PS [url]http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.7[/url] [QUOTE=Simon268](why dont think work like on the tutorials - did people try out the programmes before putting them on?)[/QUOTE]Don't be rude when it is you … | |
Re: [QUOTE=wingwarp]I am a basic c++ programer :sad: that wants to understand graphics but all the online guides confuse [/QUOTE]Which one(s) might those be? Perhaps learn the language a little better before jumping into the deep end. | |
Re: [QUOTE=ishwar]i got what i wanted , now i can hack into my school usernames, with my other keylogger i am writing,[/QUOTE]Thread closed. | |
Re: [QUOTE=sgriffiths]How would i be able to let the user enter HEX and convert it into string? ie User Enters 4c3258 and displays L2X[/QUOTE]Perhaps something like this. [code]#include <stdio.h> int main(void) { char name[10] = "4c3258", *ptr = name; [COLOR="Blue"]int i; while ( sscanf(ptr, "%2x", &i) == 1 ) { putchar(i); … | |
Re: [URL="http://www.newty.de/fpt/index.html"]The Function Pointer Tutorials[/URL] | |
Re: Might I first ask why you are using nonstandard headers and code? It seems to me that learning the basics of the language precede optimization issues. Why is "time complexity" an issue? Don't use void main. Why dynamically allocate a single int? Use good indenting and meaningful variable names. In … | |
Re: [QUOTE=chechenkerz]you may want to post code fragments regarding adding, deleting and editing the inventory items.[/QUOTE][u]You[/u] may want to post code fragments regarding adding, deleting and editing the inventory items. [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] And you may find that searching this forum, Google, or even your textbook, will provide you with thousands of examples … | |
Re: What ends this loop? [code]for(i = 0; true ; i++)[/code]Nothing, it goes "forever", or until you crash. | |
Re: You don't want to start j one beyond the end of the array (very much like you said you fixed in your last thread), you want to start it at the end of the text. And it would be better to use <= instead of != (think of what may … | |
Re: Threads merged. Some duplication removed. Code tags added -- learn to use them. | |
Re: In C, [INLINECODE]const[/INLINECODE] does not mean constant. It means read-only (whether or not such objects are placed in read-only memory or not is up to the system). If you choose to circumvent the compiler and write to read-only memory, behavior is undefined -- as already mentioned. | |
Re: [URL="http://forums.devshed.com/c-programming-42/ask-a-problem-about-template-368788.html#post1554638"]Same answer[/URL]. And please use code tags. |
The End.