Robert1995 Posted November 22, 2011 Report Share Posted November 22, 2011 Poate mai are nevoie cineva de asa ceva,stiu ca nu e mare lucru dar pana mea..#include <iostream>#include <fstream>#include <iomanip>#include <string.h>using namespace std;fstream fout("ascii.txt" , ios::out);int main(){ char text[1500]; cin.getline(text , 1000); for(int i=0;i<strlen(text) ; i++){ fout<<int(text[i]); if(strlen(text) - 1 != i){ fout<<" , "; } }fout.close();}Ex :Intestascii.txt116 , 101 , 115 , 116 Quote Link to comment Share on other sites More sharing options...
blondu08 Posted November 26, 2011 Report Share Posted November 26, 2011 Multumesc! Quote Link to comment Share on other sites More sharing options...
unknown. Posted November 26, 2011 Report Share Posted November 26, 2011 Multumesc!Mai lasa post hunt-ul,in 9 din posturile tale multumesti. Quote Link to comment Share on other sites More sharing options...
Robert1995 Posted November 26, 2011 Author Report Share Posted November 26, 2011 si ce daca multumeste , nu te gandesti si la mine ? stii ce bine ma simt cand stiu ca am ajutat pe cineva ? Quote Link to comment Share on other sites More sharing options...
cmiN Posted November 27, 2011 Report Share Posted November 27, 2011 Mai simplu:>>> " ".join([str(ord(x)) for x in "test"])'116 101 115 116' Quote Link to comment Share on other sites More sharing options...
phreak Posted November 29, 2011 Report Share Posted November 29, 2011 @cmin : python invata oricine intr-o luna. De c++ nu pot zice acelasi lucru. Quote Link to comment Share on other sites More sharing options...
cmiN Posted November 29, 2011 Report Share Posted November 29, 2011 In ziua de azi limbajele de programare sunt doar niste unelte, iar scopul scuza mijloacele.C++ invata oricine in 2-3 ani (oop, procedurala, librarii, apiuri, grafica) dar de asm nu pot zice acelasi lucru. Quote Link to comment Share on other sites More sharing options...
phreak Posted November 29, 2011 Report Share Posted November 29, 2011 Pentru unelte care functioneaza doar pe calculatorul tau, recomand python si folosesc si eu uneori dar.. daca ai chef sa faci consumer products sau spyware/malware de orice fel, ce o sa faci? stai 2 ani sa inveti? Pentru orice "security analyst" sau cum se mai numesc unii in ziua de azi este necesar sa cunoasca low level si asta inseamna C/C++/ASM , nu python.LE: ce vreau sa zic este sa nu bagati pe gat python la aia care invata c++ si nici viceversa. Nu strica sa inveti nici C++ nici python dar in opinia mea ( si in ce am avut eu nevoie, si inca am ) c++ este mult mai util. Quote Link to comment Share on other sites More sharing options...