166 Posted Topics

Member Avatar for lelejau

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.

Member Avatar for JSPMA1988
0
138
Member Avatar for J0shu
Member Avatar for mbouster
Member Avatar for Tellalca
0
210
Member Avatar for Me-Mo

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 …

Member Avatar for Tellalca
-3
149
Member Avatar for airerdem

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 …

Member Avatar for Tellalca
0
166
Member Avatar for freakyboard

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 ?

Member Avatar for freakyboard
0
104
Member Avatar for mattloto

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" …

Member Avatar for mrnutty
0
126
Member Avatar for Tellalca

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 …

Member Avatar for sundip
0
140
Member Avatar for snipermann

You can read it using standard fstream I think, since its plain text file. You dont need "visual"C++.

Member Avatar for ravenous
0
601
Member Avatar for spring10

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 :)

Member Avatar for MudasirAli
0
367
Member Avatar for faruq1407
Member Avatar for Tellalca

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() % …

Member Avatar for Tellalca
0
158
Member Avatar for skorm909

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] .

Member Avatar for vsvivek796
0
229
Member Avatar for emcyroyale

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.

Member Avatar for Tellalca
0
96
Member Avatar for Tellalca

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 …

Member Avatar for Kieran Y5
0
108
Member Avatar for MyPianoSucks

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 …

Member Avatar for MyPianoSucks
0
191
Member Avatar for yongj

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.

Member Avatar for yongj
0
1K
Member Avatar for kelechi96

Debug and see what is the error. Tell us about the error so we can help. We are not compilers.

Member Avatar for kelechi96
0
132
Member Avatar for lochnessmonster

Btw you cannot seperate the implementation and the decleration if you are working with a template class.

Member Avatar for mike_2000_17
0
311
Member Avatar for format_c
Re: Maze

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.

Member Avatar for format_c
0
112
Member Avatar for CPT

Good advice from David. Even you cannot understand this code after not seeing it for a week.

Member Avatar for Tellalca
0
133
Member Avatar for Tellalca

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 …

Member Avatar for Tellalca
0
1K
Member Avatar for .:Pudge:.

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.

Member Avatar for Tellalca
0
105
Member Avatar for noname1810

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 …

Member Avatar for Tellalca
0
158
Member Avatar for tKc

You can't tell what your problem is. Don't expect us to reply to your problem.

Member Avatar for Tellalca
0
155
Member Avatar for Tellalca

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 …

Member Avatar for WaltP
0
74
Member Avatar for Tellalca

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", …

Member Avatar for mg120
0
204
Member Avatar for sharifyboy7

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.

Member Avatar for sharifyboy7
0
256
Member Avatar for Tellalca

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 …

Member Avatar for Ancient Dragon
0
161
Member Avatar for Bri426

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 …

Member Avatar for NathanOliver
0
193
Member Avatar for rtdunlap

I dont think I got it right but simply return the avg from the float mean() and display the result. cout << mean(); //Like this ? :=)

Member Avatar for Tellalca
0
114
Member Avatar for lionaneesh

Good job but if you dont have any questions you should send this thread to "Show off your projects".

Member Avatar for challarao
0
2K
Member Avatar for Tellalca

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 …

Member Avatar for dnanetwork
0
72
Member Avatar for Alerwiali

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 …

Member Avatar for Alerwiali
0
114
Member Avatar for manutd4life

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.

Member Avatar for Tellalca
0
92
Member Avatar for yuvaraj.ragupat

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 …

Member Avatar for griswolf
0
999
Member Avatar for sreejithbabu

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, …

Member Avatar for griswolf
1
602
Member Avatar for yasemin

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 =)

Member Avatar for finito
0
99
Member Avatar for azra36

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.

Member Avatar for azra36
0
372
Member Avatar for xenanovich

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 :)

Member Avatar for xenanovich
0
1K
Member Avatar for comput scince

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]

Member Avatar for comput scince
0
89
Member Avatar for darkdai

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]

Member Avatar for Narue
0
122
Member Avatar for MrDiaz

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]

Member Avatar for MrDiaz
0
126
Member Avatar for MrDiaz

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 …

Member Avatar for MrDiaz
0
123
Member Avatar for cmsc

Not every program runs great on emulators. Try running it in a unix system.

Member Avatar for Tellalca
0
118
Member Avatar for MrDiaz

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 …

Member Avatar for Tellalca
0
117
Member Avatar for tenix

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.

Member Avatar for tenix
0
8K
Member Avatar for tenix

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;". …

Member Avatar for tenix
0
16K
Member Avatar for vanalex

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.

Member Avatar for Tellalca
0
107
Member Avatar for ce0

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 …

Member Avatar for Tellalca
0
4K

The End.