Jump to content
Robert1995

C++ . Char to Ascii

Recommended Posts

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 :

In

test

ascii.txt

116 , 101 , 115 , 116

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...