- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 19
- Posts with Upvotes
- 19
- Upvoting Members
- 16
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
73 Posted Topics
Re: Well, String is not string. You have to write it in lowercase. [CODE]void toString();[/CODE] should be: [CODE]void toString(string &target); void Employee::toString(string &target){ target = "Name: " + empName + " / Employee Number: " + empNum + " / Hire Date: " + hireDate; } [/CODE] | |
Re: Works fine for me. Can you provide how and with what you tested it then it's freezes? | |
Re: Hi, first of all storing a BLOB is very bad design. But, it would be like this: [CODE]blob_value = open('image.jpg', 'rb').read() sql = 'INSERT INTO Tab1(blob_field) VALUES(%s)' args = (blob_value, ) cursor.execute (sql, args) connection.commit()[/CODE] | |
Re: like this? [CODE]#include <iostream> #include <fstream> #include <string> using namespace std; //void calculateAverage(); //int calculateGrade(); //void updateFrequency(); int main() { //const int size=10; //int debug=size; string tmp; //int test1[size], test2[size], test3[size], test4[size], test5[size]; ifstream infile; /* for(int i=0;i<size;i++) { test1[i]=0; test2[i]=0; test3[i]=0; test4[i]=0; test5[i]=0; } */ cout<<"Reading from file ''input.txt''..."<<endl; … | |
Re: [CODE]#include<iostream> // not iostream.h #include <stdio.h> #include <stdlib.h> using namespace std; int main() { //Intro cout << "Welcome to The Final Journey v. 0.0.3 Alpha."<<endl; system("pause"); cout << "You are an adventurer, traveling from town to town, looking for monsters and bold followers."<<endl; cout << "Your homeland is Chosan, a … | |
Re: Hi, line 19 prototype, return type is char, line 172 implementation no return type. Changed it to return type char and everybody will be happy :) | |
Re: Some things got messed up it should be like this: main.cpp [CODE]//file1.cpp #include<iostream> #include"file3.h" using std::cout; using std::cin; namespace baz { extern MyClass foobar; } int main() { baz::foobar.setFOO(); baz::foobar.bar(); cout << *baz::foobar.FOO << "\n"; cin.ignore(); return 0; } [/CODE] [CODE] //file3.h namespace baz{ class MyClass { private: int foo; … | |
Re: Line 39 you should type cast: [CODE] median = (element[(int)(nep/2)] + element[(int)(nep/2-1)]) / 2;[/CODE] | |
Re: HI, first of all, it's not a good idea to store the mail plain, better generate a crypt key, and same the email on your side with the key. Anyway it would be like this: [CODE] <form method="post" action="formposting.php"> <input type="text" name= "title" size="22"> <input type="text" name= "email" size="22"> <?php … | |
| |
Re: line 6: should be: [CODE]void merge(char[],int, char[], int,char[],int*);[/CODE] better: [CODE]void merge(char[],int, char[], int,char[],int&);[/CODE] [CODE]//----------merging----------- void merge (char array1[],int size1, char array2[],int size2, char c[],int &size ) { for (int k=0;k< size1;k++) { c [k] =array1[k]; } for (int k=0;k<size2;k++) { c [size1+k] = array2[k]; size=size1+size2; } } [/CODE] Did you … | |
Re: Line 24.25. is kind of the same? I you pop you need to release memory and check if you are and the end or will will get an segv. And if you are in C++ a class would just cool. | |
Re: Hi! ftp.sendcmd is only for FTP commands. Google gave me this: [url]http://commandline.org.uk/python/sftp-python-really-simple-ssh/[/url] | |
Re: how about: [CODE] struct movieData { std::string title; std::string director; int year; int time; };[/CODE] | |
Re: did you try: [CODE] fourMatrix::fourMatrix(fourVector a, fourVector b, fourVector c, fourVector d): i(a),j(b),k(c),l(d){ }[/CODE] else the compiler takes "i" as local variable or use: [CODE]class fourMatrix{ public: fourVector m_i,m_j,m_k,m_l; ... }[/CODE] then you see is a class attribute [CODE] fourMatrix::fourMatrix(fourVector i, fourVector j, fourVector k, fourVector l): m_i(i), m_j(j), m_k(k), … | |
Re: did you try: [CODE] fstream file; file.open("Tbl_cliente.txt", ios::in); // open a file for input file.unsetf(ios::skipws); getline(file, Cli_nombre, '#'); getline(file, Cli_apellido, '#'); getline(file, Cli_dirr, '#'); getline(file, Cli_total_compras, '#'); getline(file, Cli_balance, '#');[/CODE] | |
Re: Hi! Sorry the [url]http://www.cs.nccu.edu/~gmilledge/co...ynames2004.txt[/url] doesnt work. I think you should use std::list, and no pointers if it's not neccessary! It will make your wile easier ;) | |
Re: the better question is, why it crashes? What is the real reason? | |
Re: Hi! I not sure that i got it, can you provide a example? I love examples! | |
Re: a little suggestion: [CODE] def set_name(self, new_name): #-----------------------------set's a value to a private name? if not new_name: raise ValueError, "A critter's name can't be the empty string." self.__name = new_name print "Name change successful."[/CODE] [CODE]try: crit.name = "" except ValueError, e: print e[/CODE] | |
Re: [CODE] strcpy(can->name, ch );[/CODE] better use std::string. | |
Re: Hi! I would create a base class, from which the myTemplateClass will inherit. like this: [CODE] class TemplateClassBase{}; template<class C>class myTemplateClass : TemplateClassBase{};[/CODE] This should be a list: [CODE]myTemplateClass * templateClassPtrArray[10];[/CODE] This is better: [CODE]std::list<TemplateClassBase*> templateClassPtrArray;[/CODE] [CODE]templateClassPtrArray.push_back( new myTemplateClass<int>() ); templateClassPtrArray.push_back( new myTemplateClass<char>() ); [/CODE] Code is NOT tested, was … | |
Re: You should type cast it: [CODE]float bmi =(float) (weight/(height*height)); [/CODE] | |
Re: did you try: [CODE]typedef struct DISPLAY_DEVICE_CAPABILITIES{ vector<int[3]> resolutions; int brightness; }DISPLAY_DEVICE_CAPABILITIES;[/CODE] | |
Re: did you try: [CODE]int i=0; int ch=recv(new_socket,(void*)&i,sizeof(int),0); printf("Value of a is :%d\n", i);[/CODE] | |
Re: The keys are unique, if the key is already present he will be updated. Use multimap to insert each time a new value. | |
Re: how are the permissions set? is -Index active? How the cfg looks like? | |
Re: why not like this: [CODE]#include <iostream> #include <string> class A{ std::string s; public: A(){ s = "1234567"; } char operator []( const int index ){ return s.at(index); } }; int main (int argc, char const* argv[]) { A a; std::cout << a[0] << std::endl; return 0; }[/CODE] | |
Re: you need to type cast it: [CODE]const int** constPtr2=(const int**)ptr2; [/CODE] | |
Re: here you go: [CODE] iter->first->first; iter->first->second; [/CODE] | |
Re: line 36: should to be: std::string line; line 80: strcat(strfinal, line.c_str() ); instread of: [CODE]while (! myfile.eof() ) //while the end of file is NOT reached { getline (myfile,line); cout << line << endl; strcat(strfinal, line); }[/CODE] better: [CODE]while (getline (myfile,line)) //while the end of file is NOT reached { … | |
Re: Does the function "setFirstName" take the parameter as reference? | |
Re: Correct me if I'm wrong, but shouldn't you first accept incoming connection and this connection put into epoll? Epoll will tell when the socket is ready to read or write. As far as i see, epoll_wait is to early... After bind you should accept. | |
Re: I don't see that you use hashTable or hashfunction? | |
Re: Well, maybe you should redesign your program? It looks odd. | |
Re: i found this: [url]http://www.codeguru.com/cpp/cpp/algorithms/article.php/c5123/[/url] | |
Re: it can be done much easier: [url]http://clipboard.it/v/XUb/[/url] | |
Re: I would put the whole parameter in a struct, when is more readable: [CODE]vector<double>& A, vector<double>& B, vector<double>& C, double x, double& p, double& px, double& pxx, int& degree[/CODE] better: [CODE] struct SomeName{ vector<double> A; vector<double> B; vector<double> C; double x; double p; double px; double pxx; int degree; }[/CODE] | |
Re: one of your variabes, does not support the >> operator. Which type are the variables: lvl xp str spd acc hp inventory? | |
Re: [url]http://docs.python.org/library/threading.html[/url] is your friend ;) | |
Re: maybe like this? [url]http://clipboard.it/v/kRb/[/url] | |
Re: kind like this: [CODE]CandyBar cb = {"Hershey's", .45, 225};[/CODE] Only works at initialization. Line 11. is already too late | |
Re: - wxWidgets/QT - ffmpeg - boost libs - skills i hope it was helpfull | |
Re: As far as i know, it not possible to compile ffmpeg under Visual C++, it doesn't support the C++ standard. You have to compile it the gcc under linux or MiniGW! | |
Re: Look into [url]http://docs.python.org/library/smtplib.html[/url] ;) |
The End.