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