- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
8 Posted Topics
I'm having a bit of trouble reversing a string. Here's a code snippet of how I'm currently trying to do it: [code=c] index_s1 = strlen(num_s1); for (index_s2 = 0; index_s2 <= strlen(num_s1); index_s2++){ num_s2[index_s2] = num_s1[index_s1]; index_s1--; } [/code]
Does anyone know a good way to do it? I've heard of itoa(), but it's non-standard and isn't included by default with the GCC compiler. If you believe that's the best way, how to I get my hands on the function? Ideas? HUGE EDIT: I made a stupid mistake and …
I can't be completely positive, but I'm almost sure that VC++ runs well under WINE, the windows duplication layer for Linux. I'm an Ubuntu user myself, but Fedora is debian based, so this should work (type it in the terminal): [code]sudo apt-get install wine[/code] That should install WINE for you. …
[code=c++]cin >> n;[/code] That will allow the user to input a number, if that's what you were looking for. If you need to know how to use loops, you should do a bit more studying. It isn't very hard, I promise!
wow. [url]http://www.daniweb.com/forums/announcement8-2.html[/url]
hoping you come back to read this: i think you'll find it easier to declare "using namespace std;" right after your #include headings. that way, you won't have to write it in every function, 'cause it will be declared globally so everything can use it.
if your function is strictly text based, then you don't need arguments in the parentheses for your function. if you use variables that are only used inside the function, then the same applys. however. if you need to pass information from outside the function and use it inside the function, …
if it's something you feel you might want to do in life, don't give up. the rewards of programming are great. also, hello everyone. i've always read all the posts of this forum, but for some reason never bothered signing up. i decided to, and here i am. i'm looking …
The End.
sinkingships7