2,384 Posted Topics

Member Avatar for dilip.mathews

[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]

Member Avatar for dilip.mathews
0
190
Member Avatar for Dave Sinkula

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]

Member Avatar for Dave Sinkula
0
542
Member Avatar for proteusx

Perhaps this may help a little: [url=http://www.daniweb.com/code/snippet262.html]Strings: Search and Replace[/url].

Member Avatar for proteusx
0
443
Member Avatar for Gunner54

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.

Member Avatar for Dave Sinkula
0
582
Member Avatar for joshilay
Member Avatar for Dave Sinkula
0
605
Member Avatar for Dave Sinkula

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 …

Member Avatar for hollystyles
0
245
Member Avatar for Puckdropper

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 …

Member Avatar for ~s.o.s~
0
138
Member Avatar for Sashar400
Re: C++

[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 …

Member Avatar for b2daj
0
147
Member Avatar for dilip.mathews

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 …

Member Avatar for dilip.mathews
0
221
Member Avatar for Eddy Dean

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 != …

Member Avatar for Eddy Dean
0
114
Member Avatar for RFBourquin

[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 …

Member Avatar for GloriousEremite
0
151
Member Avatar for rbabakuliyev

You might find a search engine can obtain results more quickly than a forum. [url]http://www.google.com/search?q=C+Programming+pdf[/url]

Member Avatar for Grunt
0
108
Member Avatar for Ancient Dragon
Member Avatar for Dave Sinkula
1
95
Member Avatar for mitchelltab

[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 ) …

Member Avatar for Dave Sinkula
0
187
Member Avatar for steven01

An installer (for Windows?)? [url]http://en.wikipedia.org/wiki/Windows_Installer[/url]

Member Avatar for Dave Sinkula
0
46
Member Avatar for Lun

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.

Member Avatar for ~s.o.s~
0
102
Member Avatar for bkelly

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.

Member Avatar for Dave Sinkula
0
293
Member Avatar for NavidV

You can initialize elements like that, but you are trying to assign them, which you cannot do. You can assign each member individually.

Member Avatar for NavidV
0
97
Member Avatar for himanjim

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 …

Member Avatar for Dave Sinkula
0
79
Member Avatar for priya123

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 …

Member Avatar for himanjim
0
186
Member Avatar for degamer106

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++!).

Member Avatar for degamer106
0
790
Member Avatar for hiphoprules

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]

Member Avatar for Dave Sinkula
0
157
Member Avatar for nizzy1115
Member Avatar for hollystyles
0
171
Member Avatar for portege

[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 …

Member Avatar for Dave Sinkula
0
4K
Member Avatar for alvin_aldrich

[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 …

Member Avatar for hollystyles
0
165
Member Avatar for wingwarp

[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 …

Member Avatar for Dave Sinkula
0
103
Member Avatar for ostkaka

[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).

Member Avatar for wingwarp
0
117
Member Avatar for server_crash

I got doubles at 10:14am CDT. I've had other double and triples on and off for a while now.

Member Avatar for server_crash
0
696
Member Avatar for wingwarp

goto But a real code snippet would be helpful because 99% of the time you can use on of the other loop constructs.

Member Avatar for server_crash
0
137
Member Avatar for djkross

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, …

Member Avatar for djkross
0
250
Member Avatar for dilip.mathews

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?

Member Avatar for dilip.mathews
0
268
Member Avatar for hiphoprules

[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.

Member Avatar for Dave Sinkula
0
86
Member Avatar for master4u

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.

Member Avatar for Dave Sinkula
-1
140
Member Avatar for wingwarp

[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 …

Member Avatar for wingwarp
0
167
Member Avatar for gurudatta.verma

[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]

Member Avatar for ~s.o.s~
-1
174
Member Avatar for shwetashelke

[QUOTE=Preity]I would be glad if u do da needful. Thank u[/QUOTE]Can you try saying that again in English?

Member Avatar for Dave Sinkula
0
140
Member Avatar for Phruis

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.

Member Avatar for Dave Sinkula
0
113
Member Avatar for Simon268

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 …

Member Avatar for Simon268
0
156
Member Avatar for wingwarp

[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.

Member Avatar for wingwarp
0
247
Member Avatar for ishwar

[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.

Member Avatar for Dave Sinkula
0
134
Member Avatar for sgriffiths

[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); …

Member Avatar for Dave Sinkula
0
2K
Member Avatar for Latentsage
Member Avatar for joshilay
Member Avatar for Laiq Ahmed
0
116
Member Avatar for joshilay

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 …

Member Avatar for joshilay
0
102
Member Avatar for chechenkerz

[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 …

Member Avatar for Dave Sinkula
0
84
Member Avatar for tefflox

What ends this loop? [code]for(i = 0; true ; i++)[/code]Nothing, it goes "forever", or until you crash.

Member Avatar for Eddy Dean
0
151
Member Avatar for tefflox

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 …

Member Avatar for tefflox
0
91
Member Avatar for comp_sci11

Threads merged. Some duplication removed. Code tags added -- learn to use them.

Member Avatar for comp_sci11
0
152
Member Avatar for ~s.o.s~

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.

Member Avatar for ~s.o.s~
0
162
Member Avatar for rxgmoral

[URL="http://forums.devshed.com/c-programming-42/ask-a-problem-about-template-368788.html#post1554638"]Same answer[/URL]. And please use code tags.

Member Avatar for Dave Sinkula
0
264

The End.