2,712 Posted Topics

Member Avatar for speedy94519
Member Avatar for Narue
0
295
Member Avatar for xman13157

[quote]plzzzzzzzzz tel me basics thing of programing[/quote] [QUOTE=Frederick2;1071822]yaaa gotta make variables, then use ifs and loops is ther anythn else ya gotta know?[/QUOTE] Ya gotta learn english 1st.

Member Avatar for zobadof
-7
105
Member Avatar for Afupi

Maybe this will help : [code] bool save(std::ostream& saveFile, string fileName){ //save data } [/code]

Member Avatar for mrnutty
0
106
Member Avatar for son2xp2go

>>I think do you have the idea and please help me sir with my project... Not really, care to explain a bit more?

Member Avatar for mrnutty
-1
98
Member Avatar for Murderous Mouse
Member Avatar for kele1

>>I m having a lot of errors please help Can you post the errors, and what line it points to?

Member Avatar for mrnutty
0
145
Member Avatar for tgreiner
Member Avatar for merse

[QUOTE=merse;1071562]If I want to define what is a double -> double function pointer I use: [CODE]typedef double (*double_fp1)(double);[/CODE] But what if I would like to distinguish const double -> double it is possible? And the above definition consists the const double -> duble function?[/QUOTE] you mean : [code] const double_fp1 …

Member Avatar for mrnutty
0
104
Member Avatar for zobadof

Pick 1 or 2 or all of them : [URL="http://nehe.gamedev.net/"]Nehe[/URL] [URL="http://sabia.tic.udc.es/gc/practicas/opengl_tut_externos/semwal%20tutorial/indexGLTutorial.html"]http://sabia.tic.udc.es/gc/practicas/opengl_tut_externos/semwal%20tutorial/indexGLTutorial.html[/URL] [URL="http://www.lighthouse3d.com/opengl/glut/"]http://www.lighthouse3d.com/opengl/glut/[/URL] [URL="http://www.swiftless.com/tutorials/opengl/opengltuts.html"]http://www.swiftless.com/tutorials/opengl/opengltuts.html[/URL] [URL="http://www.nullterminator.net/opengl32.html"]http://www.nullterminator.net/opengl32.html[/URL] [URL="http://www.morrowland.com/apron/tut_gl.php"]http://www.morrowland.com/apron/tut_gl.php[/URL] [URL="http://www.falloutsoftware.com/3D-OpenGL-Tutorials.htm"]http://www.falloutsoftware.com/3D-OpenGL-Tutorials.htm[/URL] (very good lighting tutorial ) [URL="http://www.videotutorialsrock.com/"]http://www.videotutorialsrock.com/[/URL] [URL="http://www.pdf-search-engine.com/opengl-red-book-pdf.html"]Free openGL red book[/URL]

Member Avatar for mrnutty
0
97
Member Avatar for merse

Posted in the correct thread this time. This is also another way, and still naive. It shows both static_assertion and exceptions. [code] #include<iostream> using namespace std; template<typename Type> struct assert_numeric{ const static int i = 0; }; template<> struct assert_numeric<short> { const static int i = 1; }; template<> struct …

Member Avatar for mrnutty
0
246
Member Avatar for es cape85

[URL="http://gmplib.org/"] This [/URL] is a good library. Try inputting 500! in their sample program and see what you get. P.S : its factorial and not fectorial

Member Avatar for jephthah
0
98
Member Avatar for new programer

To make it easier on your self. Make a function that concats two strings. [code] //add two string together and places the result in the result variable void concat(const char *left, const char* right, char * result); [/code] The you can just concat title with first name. Then the result …

Member Avatar for new programer
0
157
Member Avatar for MattyRobot

Good to see you are still keeping up with this. I can give you a tga loader if you want. You can load a tga image. I also have some loadBMP functions that loads images if you need. But anyways, check [URL="http://www.spacesimulator.net/tut3_texturemapping.html"] this [/URL] out first. Its a tutorial for …

Member Avatar for Sodabread
0
354
Member Avatar for lotrsimp12345

>>"The vector holds a list of data type int? " the word list has ambiguity. A better term(IMO) would be : The vector contains a container in which the contained container is of type int and the contained container is a stl's list container.

Member Avatar for lotrsimp12345
0
96
Member Avatar for grib

From : [code] while ((cin >> ar[i]) && (i < arSize))[/code] To : [code] while ((i < arSize) && (cin >> ar[i]) ) [/code]

Member Avatar for grib
0
402
Member Avatar for merse

No but you can adjust I guess. [code] string type; cout<<"Choose Type (int,string,float) : "; cin >> type; if(type == "string"){ myClass<string> stringClass; //do stuff } else if(type == "float"){ myClass<float> floatClass; //do stuff } //and so on. [/code] But C++ does not runtime templates.

Member Avatar for mrnutty
0
108
Member Avatar for charlie221133
Member Avatar for ncwolfe

Put the definition in the same file as the templete header, unless your compiler supports the keyword export.

Member Avatar for ncwolfe
0
224
Member Avatar for neumannj656

IN line 33, 49, and 87, remove the semicolon so the while loop executes like the above post said.

Member Avatar for Evan M
0
159
Member Avatar for PDB1982

[QUOTE=Ancient Dragon;1068594]An array and a list are two different things. Its a lot easier to sort an array than linked list.[/QUOTE] Depends of the definition of "easier" and relative to whom : [code] int A[4] = {4,5,-1,2}; list<int> B(A,A+5); std::sort(A,A+5); //sort array list.sort(); //sort list [/code]

Member Avatar for PDB1982
0
133
Member Avatar for Dex02

>>I need to write a program that count how many nubers can be divide in a interval from k to n, exemple in a interval from 1 - 10 theare "3" numbers that can be divide with 3, here is my program: Explain a bit more.

Member Avatar for zobadof
-1
113
Member Avatar for zobadof

Since "I started learning C++ November 14th 09!!" Then I would suggest to keep learning it more a while.

Member Avatar for zobadof
0
90
Member Avatar for bonotevo

Use the stl's : [URL="http://www.cplusplus.com/reference/algorithm/set_intersection/"]set_intersection [/URL] , [URL="http://www.cplusplus.com/reference/algorithm/set_difference/"] set_difference [/URL]. They also have other variants of those.

Member Avatar for Dave Sinkula
0
302
Member Avatar for matmeister

>>(all sentences are on one line) why? >> Write a C++ program that indicates whether each line on an input file...

Member Avatar for zobadof
1
334
Member Avatar for ihatestarch

The reason why one would use one over the other is for efficiency. Some operations like inserting takes constant time in linked list, while it vectors it might not. The only thing you will learn in school is how to study on your own. To become a good programmer, you …

Member Avatar for ihatestarch
0
142
Member Avatar for digital_ice7

First [code] int n, num; cout << "Enter the Number of matrix -> "; cin >> n; int s[n][n]; [/code] The n variable needs to be constant, unless your compiler allowed it, which is not good. To pass a multidimensional array you need this : [code] const int FIXED_COL = …

Member Avatar for mrnutty
0
94
Member Avatar for ihatestarch

When you don't specify a copy constructor the compiler does a shallow copy. Which means that it just copies the value from one class to another. [code] MyClass obj ( anotherMyClassObj ); //shallow copy [/code] Now if inside MyClass contains a pointer variable( allocated by new). Then that copy constructor …

Member Avatar for ihatestarch
0
79
Member Avatar for rivzzz
Member Avatar for mrnutty
0
24
Member Avatar for soccerjerseys
Member Avatar for cole davidson

Ok thats a start. Now you need to create a vector of size 26. This is how to do that : [code] vector<int> numberOfOccurance(26,0); //create a vector of size 26 with each element initialized to 0 [/code] After that you need to read in the data character by character. One …

Member Avatar for cole davidson
0
123
Member Avatar for confusedndazed

Seems fine. Although you might want to Make a const MAX_NUM_OF_NAVY then use that where ever you need it.

Member Avatar for mrnutty
0
132
Member Avatar for thinkersgroup

[QUOTE=thinkersgroup;1065238]Hi i want to friendship with a cut girl if there is anyone intrested reply me plz:*[/QUOTE] This is too funny. One of the few post that made me laugh. You made my day thinkersgroup, anyone see the irony with his name?

Member Avatar for diafol
-5
110
Member Avatar for rkulp
Member Avatar for halluc1nati0n

[code] char lesser_msg[5]; actual_len = strlen(message.c_str()); for (i=0; i<actual_len; i++) { // Pad data lesser_msg[i]=message[i]; } [/code] What happens if the actual_len is greater than 5?

Member Avatar for mrnutty
0
251
Member Avatar for ROTC89

This is not right : [code] int sort(int arr[], int vals) { int temp; for(int cnt=0; cnt< (vals-1);cnt++) { if(arr[cnt]>arr[cnt+1]) { temp=arr[cnt]; arr[cnt]=arr[cnt+1]; arr[cnt+1]=temp; } } } [/code]

Member Avatar for mrnutty
0
132
Member Avatar for kavourdoukos
Member Avatar for vishesh.verma

remember sin and cos takes angle in radians. But other than that I don't know whats your problem?

Member Avatar for StuXYZ
0
81
Member Avatar for papanyquiL

Well you cannot just dump some random code( in our perspective) and ask for help without providing us no clue. For a soduko solver, I think recursive backtracking is a ok candidate. Google it. As for your solution, I have no idea what how it works so I cannot help.

Member Avatar for mrnutty
0
156
Member Avatar for kamikazekazuo

This function : [code] float Display(int x, int y, int z) { cout << "\tAverage= " << AveXYZ << endl; cout << "\tMaximum= " << maxXYZ << endl; cout << "\tMinimum= " << minXYZ << endl; return 0; } [/code] 1st should be a void function. Seconds you meant : …

Member Avatar for m_usman
0
259
Member Avatar for mrnutty

[URL="http://www.horstmann.com/cpp/pitfalls.html"]This [/URL] is a good read. Read it and learn from it.

Member Avatar for zortec
1
78
Member Avatar for mymyzzz

[QUOTE=GrubSchumi;1064310]Hi, So for this we should rather write [CODE] for(i= 0; i <sizeof(scores) / sizeof(int); i++) [/CODE][/QUOTE] That does not work once this is not done within the array's scope. @OP : just do this : [code] for i = 0; i < arraySize ++i{ for j = i+1; j …

Member Avatar for muzamal
0
236
Member Avatar for noofin
Member Avatar for Bench
0
93
Member Avatar for new programer

Your prototype : [code] void read_salary(double , int); int max_salary(double, int); [/code] Means that they take a double variable and an int variable. Instead use this : [code] void read_salary(double Array[], int); int max_salary(double Array[], int); [/code]

Member Avatar for new programer
0
110
Member Avatar for merse

[QUOTE=Narue;1067322][B]>which one is necessary to overload if i would like to make -x understanable for the compiler?[/B] The negation operator is a single argument member function: [code] class foo { public: // Overload negation foo operator- ( const foo& obj ); }; [/code][/QUOTE] That is not overloading the negation operator. …

Member Avatar for jonsca
0
117
Member Avatar for Clockowl
Member Avatar for Stefano Mtangoo

Personally I do not find reading code much helpful. Its usually has little comments, and if not written clearly, then its not-comprehensible. I don't get out of it as much as if I would from reading books, ASKING QUESTIONS, coding or doing other things. But I do once in a …

Member Avatar for mrnutty
0
354
Member Avatar for timlo

By the example you gave us, this : "mcDonalds car 456 burgerKing 8 clowns are scary money leeking from 56 my pockets I like turtles 1". I would suggest that you should extract the sentence word by word. Then when you extract a word, you need to check if its …

Member Avatar for timlo
0
4K
Member Avatar for llemes4011

But on the other hand the efficiency of these are completely different : [code] //with pointers void DivideBigNumbers(BigNumberClass * num, BigNumberClass * num); //without pointers, just object void DivideBigNumbers(BigNumberClass num, BigNumberClass num); //and there is reference void DivideBigNumbers(BigNumberClass& num, BigNumberClass& num); [/code]

Member Avatar for Narue
0
165
Member Avatar for merse

This is your call : mystruct s(1.,2.); This is mystruct constructor : mystruct(double z) Either make the constructor : mystruct(double z , double z2); Or make the call : mystruct s(1.0);

Member Avatar for jonsca
0
104
Member Avatar for mitchstokes225

Can you use strings or char arrays ? One problem is in your binary addition function. Here is how you would add binary numbers : [code] 1 1 1 //carry ------ 1 0 1 + 1 1 ------- 1 0 0 0 [/code] remember 1 + 1 = 0 with …

Member Avatar for mrnutty
0
99

The End.