166 Posted Topics
Re: You can't, I am not talking about mixing your code with some tools. Getting access to the memory is the responsibility of the OS. If the OS give permission than you can't hide. ![]() | |
Re: You may want to define a constructor and a copy constructor. | |
Re: Airport management system, wow! Please don't make us crash into another plane. | |
Re: Trick is that don't try to get two things at the same time. Find the prime numbers between 1 - 100 then go to the algorithm that you give. Calculate the primes. You have the list of prime. Go from 1 through 100 If your number is in the list … | |
Re: If you are having problem with converting text '1' into integer 1 then look at the ASCII table. There you see the decimal value of character '1' is 49. There if you read '1' into an integer variable you are holding 49. If you just decrease that by 48 you … | |
Re: It's very hard to read your code since you have no indentation there and also we do not know even what your problem is. How can you want us to fix your problem if you don't tell the problem ? | |
Re: I will answer your question but firstly you'd better use private keyword for xPos and yPos, it's absolutely identical what you have done but it is a good programming habit and make it easier to read your code for someone else. Your problem is that when you say "Shape 1" … | |
Hey; I want to be able to use VS2010 and still pass command line arguments to it somehow. When I am building an application that needs to use argv[], I need to compile it and run it from the command line. That is becoming boring sometimes especially when I want … | |
Re: You can read it using standard fstream I think, since its plain text file. You dont need "visual"C++. | |
Re: Good project, good job. We need to know about the libraries used in the program to create an idea about alarm(). This must be an enjoyable project :) | |
Hey; I am having problem with the read and write functions in fstream. They need to have a const char * to read or write from/to buffer. I need to work with integers. Here what happens: [CODE]for(int i = 0; i < numberOfValues; i++) { int random = rand() % … | |
Re: Read Thinking in C++. It's freely available in web and one of the best sources you can find. You can download the ebook at: [url]http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html[/url] . | |
Re: You can dissassemble the code and see the assembly code there. There is almost no way turning the assembly code back into the C++ or another language. | |
Hey; I have an assignment but I'm having trouble because I don't know almost any assembly. I have figured out something but please help me if I have mistakes, and with the 3rd formula. Using knowledge from previous weeks, write assembly programs which calculate the given formulas: a)Sum (i=1 to … | |
Re: When creating a new project in VS 2010 try creating an empty project when the program asks. I think you are learning from Deitel's How to Program C++. That is a good book, but have a look at Accelerated C++ and other books whose names can be found in the … | |
Re: Did you hear about <fstream> class from the standart library. It defines some basic file input/output operations for binary and text files, but you have to give the file names to the program, there is no folder manipulating operations defined in this class. | |
Re: Debug and see what is the error. Tell us about the error so we can help. We are not compilers. | |
Re: Btw you cannot seperate the implementation and the decleration if you are working with a template class. | |
![]() | Re: You can find a project which I made last year like yours. you can check it on the Projects page of [url]www.operatasarim.com[/url]. Download the source code and see if it helps. ![]() |
Re: Good advice from David. Even you cannot understand this code after not seeing it for a week. | |
Hey; I'm practicing with template classes. When I declare a user-typed destructor for this template class, the program freezes and needs to be closed explicitly. Obviously, in the destructor, I am trying to release the memory allocated to hold the coordinates[3] array. What is the problem with declaring a user-typed … | |
Re: You may product two random numbers generated by the rand() function to get a bigger random number. That's just an example. You can create your own random number generator function. | |
Re: I won't read your whole code but it's obvious from the error you get that you are trying to write/read to/from a memory location which you dont have access. You are most probably having problem with pointers. Try debugging, see if you are trying to access to a memory location … | |
Re: You can't tell what your problem is. Don't expect us to reply to your problem. | |
How is it possible to delete a byte ( char, int, double .. ) from a text file ? Suppose that the file.txt contains :"110Hello". And I want to delete "110" from the file leaving only the "Hello" part. How to do this without reading the whole file into the … | |
I want to write and read a Student struct to/from a file. The program works weird . Sometimes reads 52 elements, sometimes 1 element. I couuld not see what the problem is. Help please. [CODE]int main() { FILE *deneme = openBinaryFile("C:\\text\\text.txt"); Student me = {"Mert","Akcakaya",200611004, 0}; Student you = {"Default", … | |
Re: string encryption(string plainText, int key) { string temp; for(int i=0; i <plainText.length();i++) { [COLOR="Red"]temp+=[/COLOR] plainText[i] + key; } return temp; } Maybe changing temp+= plainText[i] + key; to temp[i] = plainText[i] + key; would work... The same logic goes with the decryption one. | |
Hello, I really wonder that is it possible to open any file and play with the data inside it using C/C++ FILE pointer. I'm taking a lecture called Data Management and File Structures and there we are working with text and binary files. So I decided to research and work … | |
Re: I think you have lots of problems there. First what do you do with "city" after you get it with :getline(cin,city); Second you are searching substring in bigstring, but you did not initialize those strings? What you are doing is searching zero in zero ? Third you are reading every … | |
Re: I dont think I got it right but simply return the avg from the float mean() and display the result. cout << mean(); //Like this ? :=) | |
Re: Good job but if you dont have any questions you should send this thread to "Show off your projects". | |
I have a details view and SQL data source. In the details view i can fill the form and add the data to the database and then view this database in another page. I have a "Date" row in the details view where must insert the date info. I want … | |
Re: Maybe because of the limits of the integer type. Integers can hold numbers up to 32768 ( as i remember ). So any value greater than 2^16 will overflow and give you uncorrect results. You may try using double or a user created type to hold values for factorials as … | |
Re: NP-complete is absolutely right. Before you sit infront of the computer and start coding you'd better figure out what you really want to do and how would you solve the problem. Design an algorithm. | |
Re: I didnt get what you mean by function to pointer but let me explain something: 1- If you pass an arguement to a function without using pointer you pass it by value. In that function if you change the arguements value, when you get back from that function the value … | |
Re: If you like programming and you believe that you will be good at it then I'd go for it. A good programmer can learn about every aspects of a computer. For example a good programmer can become a web designer easily( I dont mean using PS or another design program, … | |
Re: You may try adding up to lets say 100 and then divide all the values by 100 and assign them to the variables. Like; a=25 b=30 c=40 d=5 adds up to 100. var1=25/100 var2=30/100 .... If you get stuck post here again. Kolay gelsin =) | |
Re: mitrmkar catched really nice. The value is a bad pointer. You should check that value. Please pay attention to your spelling when you are posting so we can follow easily. | |
Re: Does the function ( read/write ) you first call in the program works and the following does not? If so maybe you should do some procedure before attempting to do another work. I never programmed serial port before , it is just an idea :) | |
Re: You want to have a Graphical User Interface. Look for some GUI libraries for C. Checkout : [url]http://winprog.org/tutorial/simple_window.html[/url] | |
Re: Look at ASCII table and note the decimal values of chars you want to randomize. Then randomize values, then print them with using "%c" placeholder. For example; [CODE]char example = 97; int exapmleinteger = 97; printf("%c", example ); printf("%c", exampleinteger );[/CODE] will both output 'a'. [url]http://www.asciitable.com/[/url] | |
Re: The following code checks if the letter exist and occures less then 40 times. Maybe this is what you want ? [CODE]if( lettes[i] > 0 && letters[i] < 40 ) letters[i] = 1;[/CODE] | |
Re: You say that indexes of the array represents chars. Since indexes are unique there will be only one char for the corresponding index. How can there be 15 A where there is only one array[0] ? And what those array elements are for? Where do you use them? I didnt … | |
Re: Not every program runs great on emulators. Try running it in a unix system. | |
Re: You can assign the value returned by the function "strlen(textStr)" so you avoid calling this function strlen*26 times :) [CODE]int a = strlen(textStr); for(j = 0; j < a; j++) { ... } [/CODE] Maybe you should use binary files instead. This will decrease the encoding and decoding of the … | |
Re: Ofcourse it is possible, but if you want us to implement and send you the code that's not gonna happen. Maybe you should send what you've got, then we may give you some ideas. | |
Re: First if you want to dynamically enlarge the array you should use malloc and calloc, which dynamically reserves memory while the program is running. If you want to insert values to an array, you should have the array element at the right side of the expression like "arr[i] = something;". … | |
Re: You should avoid using float values in conditions. The problem with your code is "scanf("%d", &n );". You are getting input in the form of integer so you are ignoring the fraction part of the input. You should use "scanf("%f", &n);" to get a floating number. | |
Re: In debug mode you can see what value is copied into char c, maybe you must clean the buffer before you take the character with scanf. Some advice from me: 1-Use meaningful variable names, such as state, condition, myArray. It really helps you and us figure out what the problem … |
The End.