I have an open file dialog that opend the xml file and store the path to the textbox, it returns the path correctly but when i need to store that xml file into the database it tells me that there is an error next to '' because when i try to debug it it gives me "C:\Student Results\FC2015.xml" this results then it breaks. here is my code:
I have a problem i have a textbox filled with info when the button is click but what i need to do now is when new info is place in the textbox i need the results textbox's to clear and the new info put in the textbox.
I am new to C, but I recently completed an exercise from a book that finds a string in another string, removes the string, and replaces it with another string.
I have a challenge to replace all the words "you" in a sentence that is entered by a user to "u". I have got this working but my code is also changing yourself to urself which it should not be doing.
I'm having a bit of problem. I've set the string 'Absent' to all student in a file. However, I want to replace 'Absent' with 'present' when the correct ID assigned to a student is entered. In other words, 'Absent' will only change to 'Present' for a specific person at a time. I'm not sure how to implement this
To replace a string in my file with another. The file contents look like the following:
abc 123 0
"abc"= The username "123"= Their password "0"= The amount in their bank
I want to change their bank amount.
But, it isn't working, nor is it even giving me an error code.
// When the user logs out, make changes to their bank string strNew = std::to_string(player.bank); // String representation of the revised player bank ifstream filein("user_accounts.txt"); // Old repository of player data ofstream fileout("user_accounts_new"); // New repository of player data
I am a beginner of c#.. i have try to made a windows notepad and face some issues. I want to add find string from open file... and also want to replace it with a new string... Is there any simple and easy solution to this problem??
So I'm trying to create a function that replaces any instance of a character in a string with another. So first I tried the replace() string member function:
#include "NewString.h" using namespace ...; int main()
[Code].....
Instead of replacing the the l's with y's it outputted a long string of y's. Also, NewString is derived from the string class (it's for the assignment). the header and whole implementation file, already tested.
I've also tried, instead, to use a for loop in ReplaceChar() but I need to overload the == operator and I don't know how I should exactly:
I want the == operator to test if the value in the char array is equal to target but I'm not sure how to pass in the position. I'm guessing the this pointer in ReplaceChar() is not the same as the one dereferenced in ==() because target is never replaced by entry in the string.
I'm creating simple console application using Code::Blocks to allow me to pass parameters from other application to replace string within text/registry file before execute the registry merge. Passing parameters to console already success. Now I only have problem with reading file. Example of first line in the registry file is as below.
Windows Registry Editor Version 5.00
However when read into string and output to console using 'cout', it will be show as below with spaces in between.
W i n d o w s R e g i s t r y E d i t o r V e r s i o n 5 . 0 0
I'm trying to get the int value of each character in a string and then add them all together so I can do a 1's complement of the total value. I'm trying to do simple checkum kinda of thing for verification of data.
For example: string DPacket = "Hello World!";
I would like to have each character added and do the ones complement. Will it be easier to convert first to int and then add or any other easier way? So my result should be the decimal value addition of each character and then do the ones complement to that.
Copy some characters from char * arg to char * first using a loop with specific conditions.
Code:
char * arg; // set arg some string... char first_[25]; char * first; int length; length=strlen(arg); for (n++; arg[n] != '}' || n>=length-1; n++) strcpy(first,arg[n]); // first += arg[n]; I have strcpy(first,arg[n]); but arg[n] is char and strcpy expects char * ;
I'm trying to find a < character in a document, get it's position. Then find > and get it's position. Then i want to delete all things between that but runtime is terminating my process so i don't know what to do.
I want to input a string, say: abcdaa so, the program should output:
a b c d
In other words, the program will display each character for only ONCE!!!! And display their frequency. Here is my idea: user will input a string and such string will be copied into another string variable called "checker".There will be a loop and each character will be printed, BUT, first, the program will check if the character to be printed is not equals to all elements of the checker string.
I already have the function to count the frequency of each character
GOAL: to make a program that will accept a string and use the HUFFMAN CODING to compress it.
I wish to convert a character directly to a string for a top-secret project I'm working on. It needs to be portable across various machines with different sized Indians.
Code:
#include <stdio.h> int main(void) { const int i = 0x0041; const char *str_p = (char *) &i; }
[code]....
I want this to output an 'A', but I'm not sure this code will work on my friend's mom's S/360.
I am still working on my project which will be reading some old data from some old DOS files. The data stored there is naturally, char*. Once I read in my character array, how do I assign this to a wstring since my application is UNICODE?
Here is my current solution:
wchar_t* Class::Function(char *pName) { //I verify the pointer and such first, then do the below this->_Name.assign(pName, (pName + strlen(pName)); return this->_Name.c_str(); }
I have been trying to write a function which can convert a number from an unsigned long integer to a readable ASCII character string. this is what I have come up with, but I am receiving some very strange characters in return. Could the problem be that I am telling a char to = an unsigned long int, (cString[i] = product[i])?
void convertToString(unsigned long con) { unsigned long product[10]; char cString[10]; const unsigned long begConvert = 10 ^ 10;
I am trying to take a string that is within the main function, and write a void function that gives me the most common alpha character used inside the string. How to mix a string and an array together like that as I am not too familiar with arrays yet.