377 Posted Topics

Member Avatar for mypopope

[QUOTE=ShawnCplus;420059] [code=c++] int main(void) [/code][/QUOTE] In C++ this is considered bad style. In fact, the main(void) style has been called an [URL="http://www.research.att.com/~bs/sibling_rivalry.pdf"]"abomination"[/URL] by Bjarne Stroustrup, the creator of C++, Dennis Ritchie, the co-creator of C, and Doug McIlroy, head of the research department where Unix was born.

Member Avatar for WaltP
0
239
Member Avatar for corolaron
Member Avatar for icetux
Member Avatar for Salem
1
221
Member Avatar for venomlash

Here's another [URL="http://www.cplusplus.com/doc/tutorial/exceptions.html"]tutorial[/URL]

Member Avatar for vijayan121
0
158
Member Avatar for Ashu@sym

[QUOTE=Ashu@sym;426879]hello everyone, i am a rookie in C++ programming, can someone please clarify my one doubt regarding difference between handles and pointers ?? actually i am little confused about handles, can any one please clarify what exactly is a Handle and why is it used??[/QUOTE] The term handle is used …

Member Avatar for SpS
0
260
Member Avatar for Lost in Code...

[QUOTE=TkTkorrovi;425631] [code] printf ("== press enter ==\n"); getchar (); [/code] [/QUOTE] This would be better [code=c] printf("Hit 'ENTER' to exit\n"); fflush(stdout); (void)getchar();[/code]

Member Avatar for WaltP
0
197
Member Avatar for joydsouza90

[QUOTE=joydsouza90;425218]How do you clear a string in a single statement ? for egs. i want to clear name[20] of all its contents and leave it completely empty Please help :-/[/QUOTE] [code=c++] const char *str="SpS"; cout << str; str = NULL; [/code]

Member Avatar for WaltP
0
9K
Member Avatar for shannonpaul

> I need to display 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 ... I "must" use the "for" ... This is what I have but it only counts by two. I don’t want the answer ... however can you please give me some clues on the proper …

Member Avatar for ndeniche
0
127
Member Avatar for tonyaim83

[quote=tonyaim83;425113]How do i create a 2-D array using a vector which is dynamic in nature. [/quote] You can make use of [INLINECODE]vector<vector<T> >[/INLINECODE]

Member Avatar for vijayan121
0
131
Member Avatar for tonyaim83

[quote=tonyaim83;425110]How do i create a two dimensional dynamic array of type string using vector. Also let me know if how can i use "find" on this array..[/quote] You could approach like this [CODE=c++] #include <vector> template <typename T> class dynamic_array { public: dynamic_array(){}; dynamic_array(int rows, int cols) { for(int i=0; …

Member Avatar for iamthwee
0
129
Member Avatar for Sukhbir

[quote=zmariow;424263]Dynamic Binding is a concept that applies to Object Oriented Programming. C is not object oriented. What is it you're trying to do... explain more and maybe we can give you some ideas :)[/quote] Objective-C is a language based upon C, with a few additions that make it a complete, …

Member Avatar for SpS
0
133
Member Avatar for Darnie

[quote=Darnie;423959]If you have an example please help me[/quote] [url]http://www.daniweb.com/forums/announcement8-2.html[/url]

Member Avatar for SpS
0
131
Member Avatar for mpplumb

Internet File Downloading Function [URL="http://www.daniweb.com/forums/Internet%20File%20Downloading%20Function"]http://www.codeguru.com/cpp/i-n/internet/filetransfer/article.php/c3399/ [/URL]

Member Avatar for mpplumb
0
134
Member Avatar for karimnouh

[quote=Boldgamer;422307]I don't know. But most here will tell you to never use void main()[/quote] Startup routines that call [B]main[/B] could be assuming that the return value will be pushed onto the stack. If [B]main()[/B] does not do this, then this could lead to stack corruption in the program's exit sequence, …

Member Avatar for Infarction
0
304
Member Avatar for ashok_169

I would highly recommend [URL="http://www.codeblocks.org/"]CodeBlocks[/URL]

Member Avatar for TkTkorrovi
0
119
Member Avatar for rati

You can provide static create() member functions which create the object using new and return a pointer to the allocated object. [code=c++] typedef auto_ptr<Test> TestPtr; TestPtr Test::create() throw(bad_alloc) { return new Test(); } [/code]

Member Avatar for vijayan121
0
95
Member Avatar for AquilesBailo

[QUOTE=AquilesBailo;421627]Hello everyone ^_^ I need to know how to pause the execution of a code, without using sleep() or any sleep()-kind function thats it... thanks XD[/QUOTE] In C++, you can do something like this [CODE=c++]#include <iostream> #include <limits> int main() { // Rest of the code //Clean the stream and …

Member Avatar for Ancient Dragon
0
171
Member Avatar for Firestone

Read this [url]http://www.eternallyconfuzzled.com/tuts/languages/jsw_tut_pointers.aspx[/url]

Member Avatar for VINEET KUMAR
0
181
Member Avatar for atrusmre
Member Avatar for psyman_86

Just take [inlinecode]typedef int value_type;[/inlinecode] out of class. Things should work.

Member Avatar for psyman_86
0
447
Member Avatar for Marine

You can use [inlinecode]istringstream[/inlinecode] [code=c++] #include <sstream> #include <iostream> int main() { std::istringstream stm; double number; stm.str("6.8123456789123456789123456789"); stm >> number; std::cout<<"Converted Value: "<<number; return 0; } [/code]

Member Avatar for SpS
0
219
Member Avatar for gaurav252

Read about [url=http://www.c-faq.com/expr/seqpoints.html]Sequence Points[/url]

Member Avatar for Ancient Dragon
0
205
Member Avatar for almy

[quote=almy;421828]what u mean???the flow code???sorry coz i'm 1st year at university so i dont know about this...:-p[/quote] You can make use of [INLINECODE]qsort()[/INLINECODE] or [INLINECODE]std::sort[/INLINECODE][B][/B]

Member Avatar for rati
0
148
Member Avatar for hoceandress
Member Avatar for darkagn
0
117
Member Avatar for amishosh

In case [inlinecode]char *name="Yankee Duddle";[/inlinecode] string literal turns into an unnamed, static array of characters, and this unnamed array may be stored in read-only memory, and which therefore cannot necessarily be modified. Trying to modify it is undefined behaviour. Whereas in case of [inlinecode]char name[]="Yankee Duddle";[/inlinecode] you can modify the …

Member Avatar for Salem
0
190
Member Avatar for Slavrix

Try this [code] CC=g++ ass1: main.o ass1.o $(CC) main.o ass1.o -o ass1 main.o: main.cpp ass1.h $(CC) -c main.cpp ass1.o: ass1.cpp ass1.h $(CC) -c ass1.cpp[/code]

Member Avatar for Slavrix
0
264
Member Avatar for toko

Classes are a way to localize all the state (data) and services (typically member functions) associated with a cohesive concept. The main idea is to organize things so that when changes to the concept or abstraction occur (as is inevitable), it will be possible to go to one place to …

Member Avatar for Bench
0
117
Member Avatar for sainiricha

[QUOTE=sainiricha;400866]Can anyone help me out to start graphics in C!!! i cant understand what books i need to reffer n which online tutorials i should take!![/QUOTE] You can make use of [URL="http://www.hypertriton.com/agar/"]AGAR[/URL] Agar is a set of libraries for developing graphical applications that are portable to numerous platforms. Agar is …

Member Avatar for TkTkorrovi
0
108
Member Avatar for toko

[URL="http://www.codeproject.com/cpp/Reversedisasm.asp"]C++ Reverse Disassembly[/URL]

Member Avatar for SpS
0
94
Member Avatar for avgprogramerjoe

Sample code [code=c++] #include <iostream> using namespace std; int main() { int x; // A normal integer int *p; // A pointer to an integer p = &x; // Read it, "assign the address of x to p" cin>> x; // Put a value in x, we could also use …

Member Avatar for SpS
0
303
Member Avatar for laseredd

You can add validation to your code by doing somthing like this [code=c++] #include <iostream> #include <algorithm> #include <sstream> using namespace std; struct nondigit { public: bool operator() (char ch) { return !isdigit(ch); } }; int main() { int num; string str; bool flag=false; cout<< "Enter number: "<< endl; cin>>str; …

Member Avatar for SpS
1
127
Member Avatar for tlly
Member Avatar for jan1024188

[QUOTE=jan1024188;294909]Im realy confused now...could you write an example?[/QUOTE] Search the snippets section. You'll find code for that.

Member Avatar for apurv
0
117
Member Avatar for Elfshadow

I've used both of them and I find Code::Blocks much lighter and equally powerful as DEV C++.

Member Avatar for micdareall
0
108
Member Avatar for Mr.UNOwen

[QUOTE=Mr.UNOwen;293232]1 How do I do it the portable way? -find file size[/QUOTE] Since you mentioned C, so I cannot suggest you Boost::Filesystem You will have to use platform specific codes like [inlinecode]stat[/inlinecode] of unix and some equivalent function in windows with chain of #ifdef's. You can also use [inlinecode]fstat[/inlinecode], or …

Member Avatar for WaltP
0
129
Member Avatar for d_1386

You don't need to start duplicate threads for same problem. Check this [URL="http://en.wikipedia.org/wiki/Scheduling_algorithm"]Scheduling Algorithm[/URL]

Member Avatar for Salem
0
262
Member Avatar for nuwan243

[QUOTE=nuwan243;294183]08)Can we read from a port while write to the same port? When we short the TX and Rx pins the value TX can be captured from the same port as a data read from port?[/QUOTE] [URL="http://www.eng.auburn.edu/~doug/serial.html"]Serial Port Programming[/URL]

Member Avatar for SpS
0
174
Member Avatar for Boldgamer

[QUOTE=Boldgamer;293530][COLOR=#000000]Hello everyone. I am interested in learning C++ and am looking for a good book to start out with. I read the topic in the sticky in this forum and have narrowed my choice of beginner books down to either [/COLOR] [COLOR=#000000] [/COLOR] [COLOR=#000000]A) [/COLOR][COLOR=#000000]C++ How to Program by [COLOR=black]Harvey …

Member Avatar for may4life
0
169
Member Avatar for cdwind
Member Avatar for DynamitMsk

[QUOTE=DynamitMsk;293114]Hi everyone, I've been working on this for days, but just can't get it. I have a linked-list containing edges of a weighted directed graph, and my goal is to find a path from vertex A to vertex B going through exactly n nodes. Anyone has suggestions, or links with …

Member Avatar for DynamitMsk
0
117
Member Avatar for kenshihimura

[QUOTE=kenshihimura;292352]Somebody can help me on this simple VB C++ program?[/QUOTE] [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url]

Member Avatar for Lerner
0
152
Member Avatar for adam37

[QUOTE=adam37;292254]Hi, I'm revising for an exam comming up in C Programming. Can anyone help by answering some typical questions which might come up in the examination. Any help would be appreciated. [B][U][COLOR=#000000]Basic data types[/COLOR][/U][/B] [U][COLOR=#000000] [/COLOR][/U] [LIST] [*][COLOR=#000000]What are the different types of data?[/COLOR] [*][COLOR=#000000]What are signed and non-signed data …

Member Avatar for Colin Mac
0
151
Member Avatar for kararu

[QUOTE=kararu;291688]The differences are listed here [URL]http://www.geocities.com/karthika_79/diff.html[/URL] hope this helps, karthika[/QUOTE] Anyone following this thread, read this instead [url]http://david.tribble.com/text/cdiffs.htm[/url]

Member Avatar for John A
0
179
Member Avatar for spaceboy

[QUOTE=spaceboy;290952]I'm looking for a C++ certification course, but there seems to be about 1001 offerings on the net, and the last thing I want to do is spend my money on something that employers won't recognise as legitimate.[/QUOTE] You can get a very good job without a certification in C++ …

Member Avatar for spaceboy
0
120
Member Avatar for andrax

[QUOTE=andrax;291720]Sorry, I was looking for something a little simpler and little more free :P[/QUOTE] [URL="http://www.codeproject.com/tools/visualleakdetector.asp"]Visual Leak Detector[/URL]

Member Avatar for andrax
0
204
Member Avatar for manu124
Member Avatar for paradox814
0
161
Member Avatar for green_oasis

Please use code tags while posting code. What do you not understand in the output? If you are wondering about increase in size of class C then read about virtual functions, virtual table, virtual pointer etc.

Member Avatar for ~s.o.s~
0
171
Member Avatar for jvignacio

Input is always three numbers of two digits or it can be 'n' numbers consisting any number of digits?

Member Avatar for dubeyprateek
0
123
Member Avatar for mistermister

[QUOTE=mistermister;291091]but why that was happening with me i cant got it, why just printing the last line ???????[/QUOTE] Nick replied to that. Read again [QUOTE=Nick Evan;291086]You're only executing this: [inlinecode]sprintf(value,s); [/inlinecode] in your while loop. What you want to do is: [code=cplusplus] while(fgets(s,1000,f) != NULL) { sprintf(value,"%s", s); printf("%s",value); } …

Member Avatar for mistermister
0
116
Member Avatar for omlaka

[QUOTE=omlaka;291129]Hi All,As usual. I am a silent member until I have passed my exam. Recently, I passed my exam with 95% for 1Z0-042. Meaning 95% of the questions are from certmagic.com guide. There a few new questions, which I am not familiar with. These questions would be remaining 5% of …

Member Avatar for Dani
0
109

The End.