73 Posted Topics
Re: The sockets will be still the same, the data will be encrypted. | |
Re: this should help: [CODE]void printRetrieve(studentList & students) { cout << "printing list"<<endl; for( studentList::iterator it = students.begin(); it != students.end(); it++ ) cout<< *it<<endl; }[/CODE] this is a copy, the list wont be altered [CODE]enrollStudent(studentList l);[/CODE] | |
Re: here you go: [CODE]#include <iostream> //#include <conio.h> using namespace std; template<typename T, typename C> T func(T *array,C loc) { T ch; cout<<"\n which alphabet u want to find: "; cin>>ch; for(C j=0;j<loc;j++) { if(array[j]==ch){ return j; } } return 0; } int main() { const int max=10; char arr[max]; int … | |
Re: [url]http://clipboard.it/v/Wmb/[/url] Works but it not very efficient! | |
Re: sure, temp is NULL, but i don't see where you add a new node with "new AVLNode"? | |
Re: How does the declaration looks like for f() ? | |
Re: Sorry but to put images/files into the Database, this is the most stupid thing what you can do. FS should take care of it, to the DB! Bad Design! | |
Re: [QUOTE=firstPerson;1059772]you are probably reading/writing a invalid memory.[/QUOTE] usually the program just crash, not stop. | |
Re: BAD: [CODE]void draw(Carbol a)[/CODE] GOOD: [CODE]void draw(Carbol &a)//referfence[/CODE] | |
Re: I think you should do this: [CODE] CPP Node* List::at(int index) { Node *temp = head; int i; for(i = 0; i < index; ++i) { temp = temp->next; } return temp; }[/CODE] [CODE] H Node* at(int index);[/CODE] | |
Re: i think think make more sense: [CODE]#!/usr/bin/env python # File: .py # Author: shadytyrant@gmail.com # Date: 2009-11-25 # Notes: #-------------------------------------------- class LibraryManager(): def filter(self, *args, **kwargs): """ Search by kwargs or args""" pass def add(self, *args, **kwargs): """ Add by kwargs or args""" pass def remove(self, *args, **kwargs): """ Remove … | |
Re: That is right, set is has unique elements and is sorted. Yes is possible, you have to write a own remove function. like: - remove only if is already in list/vector - while not unique | |
Re: i didn't understand it to 100%, but you can convert number to string very easy with stringstream([url]http://www.cplusplus.com/reference/iostream/stringstream/[/url]) | |
Re: use valgrind --leak-check=full it will tell you where you have a leak ;) | |
Re: WinApi is nice but QT or wxWidgets are portable! i think WinApi like MFC is old and obsolete! | |
Re: this should help, is not the perfect ways, but it works: [CODE]#include <iostream> #include <cstring> using namespace std; int main ( int argc, char *argv[] ) { if(argc > 1){ if (strcmp(argv[1], "-d") == 0){ cout<<"yes, it works"<<endl; } else{ cout<<"no, it won't read the if statement"<<endl; } } }[/CODE] | |
Re: would't it be easier to use? : [CODE]string lastNames(std::list<string> name_list){ stringstream ss; for(std::list<string>::const_iterator i = name_list.begin(); i != name_list.end(); i++){ ss << '"' << i->substr(0) << i->erase(i->find(',')) << '"' << " "; } return ss.str(); } [/CODE] what exactly should come out, i need an example! | |
Re: i would use: - std::queue - instead of char sender[20],recipient[20],content[100],date[10]; -> std::string - strcpy would obsolte with std:.string - instead of: [CODE] void receiveMessage(Que q) { Message m=q.remove(); if(strcmp(m.sender," ")!=0) { cout<<"\nDate: "<<m.getDate(); cout<<"\nFrom: "<<m.sender; cout<<"\nTo: "<<m.recipient; cout<<"\nContent:"<<m.content; } else cout<<"\nNo messages to receive."; }[/CODE] [CODE] void receiveMessage(Que q) { … | |
Re: Hi, first if i use C++ i also use C++ tools, like: instead of: #define FALSE 0 #define TRUE 1 typedef short Boolean; this: //#define FALSE 0 // == false //#define TRUE 1 // == true //typedef short Boolean; // == bool | |
Re: i think think is better but not perfect: [url]http://clipboard.it/v/ibb/[/url] | |
Re: Hi, first of all you should use m_ for member variables and second C++ is NOT C, you should use vector or list you save the data and sort. Just an idea But here the code twith out segv: [CODE]#include<iostream> using namespace std; class Heapsort { private: int *array; int … |
The End.