Hi! I've encountered another problem, The code below is just the part of the code where the error occurs int FindStr(FILE *f, char *str) { int s_pos; //string position in the text int c_pos; //char position in the text char *string; char ccnt; //char count s_pos = -1; c_pos = 0; string = malloc(strlen(str)); At the last line the compiler(DEV C++)says that there is an invalid conversion from void* to char*.... I didn't understand the error. Can anyone explain? Thanks in advance Anurag

Member Avatar
Member Avatar
+0 forum 15

Hi guys... guess i won't be posting after this for a long time.... could you all please help me out with syntax highlighting in c++ once again. I have made a full featured text editor(please check the snippet C.L.O.S.E) but could you please suggest about syntax highlighting or atleast indentation.. I have read one in csharp using RegEx. Can we do that same here? Please help. Anurag

Member Avatar
Member Avatar
+0 forum 4

Hi guys! I want the user to enter the day, month and year in a dd/mm/yyyy format. But what i've written doesn't seem to work. Code: [CODE]char d[2]; char m[2]; char y[4]; cout << "Day:"; gets(d); cout << "Month:"; gets(m); cout << "Year:"; gets(y); [/CODE] In the output, it doesn't stop for Day, Goes for month.. and suddenly program crashes at Year. Any Help?

Member Avatar
Member Avatar
+0 forum 2

Hi guys, I've compiled the code given below which allows the user to enter the address of a text file and then view it(the whole thing). But, as soon as input is taken, "openfile.exe has encountered a problem and needs to close. Send Error Report." When I Press Debug something in assembly language pops up. [CODE]#include <iostream.h> #include <fstream.h> int main() { char *fname=0; cin >> fname; ifstream OpenFile(fname); char ch=0; while(!OpenFile.eof()) { OpenFile.get(ch); cout << ch; } OpenFile.close(); }[/CODE] Can anyone please mention the error? Constructive Suggestions Appreciated. Cheers, Anurag

Member Avatar
Member Avatar
+0 forum 11

Hey Guys, Recently ive been developing a text editor when i came to stop. [ICODE]system("cls"); cout <<"\t\t-------------------------------------" <<endl; cout <<"\t\t| NEW FILE |" <<endl; cout <<"\t\t-------------------------------------" <<endl; cout <<"\t\t|Enter New File Name| "; getline(cin,createfile); cout <<"\t\t----------" <<endl; getline(cin,text);[/ICODE] here getline accepts code only until one press enter key How to enable the same option when enter key is pressed twice? Please Immediately Help. Thanks beforehand. Anurag

Member Avatar
Member Avatar
+0 forum 29

Hey guys, recently i've tried to compile this command line email program I get the error: cannot find -lobjc ld returned 1 exit status Here's my code. Any Help Appreciated. [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> #include <winsock.h> #define NETWORK_ERROR -1 #define NETWORK_OK 0 FILE *fp; char buffer[200000]; char buff[100]; char mess[200000]; char inserpde[100]; char mage[100]; char sndto[100]; char mesfrm[100]; char temp[200]; char tempone[200]; char *p; char* TmpStr(size_t); char* mid (char*,int,int); void ReportError(int, const char *); char sendmail( char *filename, char *server, char *to, char *from); int main(int argc, char *argv[]) { if (argc!=5 ) { printf ("\n"); printf("Usage: …

Member Avatar
Member Avatar
+0 forum 5

I have made the following code to find a string in some lines of text But it always mentions the error: no matching function for call to 'strcmp(std::string&, std::string&)' [CODE]#include <iostream> #include <string> #include <fstream> #include <sstream> using namespace std; int main(){ cout << "Please enter some text" <<endl; string text; string ch; getline(cin, text, '~'); istringstream iss(text); string x; iss >> x; ch = text; system("PAUSE"); cout << "-----------------"<<endl; string need; cin >> need; if (strcmp(x, need ) == 0){ cout << "Exact.." << endl; system("PAUSE");} else{ cout << "ErR."<<endl; system("PAUSE"); } } [/CODE]

Member Avatar
Member Avatar
+0 forum 10

Hey guys, sorry for the bad rep. But, recently i've obtained a code in c++ which highlights c# syntax in a Richtextbox. [URL="http://www.c-sharpcorner.com/UploadFile/duncanharris/SyntaxHighlightInRichTextBoxP212012005044912AM/SyntaxHighlightInRichTextBoxP2.aspx"]LINK[/URL] I think the basic idea behind it is to specify an array of strings, and now the program should search and highlight the defined strings in a file. Any help. Anurag

Member Avatar
Member Avatar
+0 forum 11

As the title suggests Any help for keypress action folks?? Do we have a keypress func in c++. I'm runnin Win Xp Dev c++

Member Avatar
Member Avatar
+0 forum 4

Can anyone of you suggest, how to create syntax highlighting functionality I would like a code snippet. Please, Anurag

Member Avatar
Member Avatar
-2 forum 4

This is my code to create a new file below. The main problem is that the program does not halt for entering file name and also the program creates a file .txt and doesn't save anything in it. Please Help [CODE]int newfile() { system("cls"); cout <<"\t\t-------------------------------------" <<endl; cout <<"\t\t| NEW FILE |" <<endl; cout <<"\t\t-------------------------------------" <<endl; cout <<"\t\t|Enter New File Name| "; getline(cin,createfile); cout <<"\t\t----------" <<endl; string text; int nl = 0; cout<<"Press enter twice in a row to quit: "; while (nl < 2 && getline(cin, text)) { if (text.empty()) { ++nl; } } if(! outfile) { cout <<"error …

Member Avatar
Member Avatar
+0 forum 7

How do i call another c++ code or an *.exe application in another cpp code. I actually wanted to create an AppSuite which contains an editor, a web browser, an address book etc. How to include all apps in one menu?? Any help will be appreciated, Anurag

Member Avatar
Member Avatar
+0 forum 3

The End.