C/C++ Programming Help Thread
This is a discussion on C/C++ Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; adrahil - I know it's no where near as optimized as the string.h functions are, and to me, I was ...
-
06-16-2007, 12:37 AM #5071words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
adrahil - I know it's no where near as optimized as the string.h functions are, and to me, I was converting a larger array of characters into a smaller one with specific start and end elements :-P

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
06-16-2007, 12:58 AM #5072Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
Is there a command that cleans up the directory?
i mean deleten all .O's , .elfs , but dont touch the source
-
06-16-2007, 01:28 AM #5073QJ Gamer Green
- Registriert seit
- Sep 2006
- Ort
- Cape Town, South Africa
- Beiträge
- 714
- Points
- 5.795
- Level
- 49
- Downloads
- 0
- Uploads
- 0
make clean
-
06-16-2007, 01:36 AM #5074Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
oke i made a programm for nothing :P , thnx anyway;)
-
06-16-2007, 05:40 AM #5075
Am I doing struct pointers right?
That's the best I can explain without actual code.Code:typedef struct { some vars here; } sometype; typedef struct{ sometype something; } parent; callingfunc (&someparentstruct.memberstruct); void somefunc(sometype* *thestruct) { *thestruct.membervar = something; }
I would like to directly change a member from some struct directly by using "Passing by reference"
-
06-16-2007, 06:12 AM #5076It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
thestruct->member = value
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
06-16-2007, 07:41 AM #5077words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
or
(*thestruct).member = value
:-P
P.S. Being a general C question, you really should've googled for it before posting here.
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
06-16-2007, 09:22 AM #5078
I always ask instead of google.
Zitat von SG57
-
06-16-2007, 09:26 AM #5079QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Why should we give you an answer if you haven't tried to figure it out on your own first?
Zitat von Mr305
-
06-16-2007, 10:11 AM #5080QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
Which is the reason why a lot of people on internet forums get so easily pissed on questions that get asked.
Zitat von Mr305
Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.
-
06-16-2007, 12:04 PM #5081
Zitat von -PSPJunkie-
Hello... Please, everyone, the doc and everyone.. Think before u type...
Zitat von Raphael
I meant ask as www.ASK.COM like www.GOOGLE.com... to all!
I prefer ask.com not google.com, which is a leading web search engine that is reliable and relevant in results.
That is why the text Google and Ask was italicized in the prev post.
-
06-16-2007, 01:15 PM #5082QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
Ok, then that joke went aside of me, because I just don't know ask.com.
Sorry for that, but I wasn't just talking about you, but about the general attitude of people to rather ask questions on a forum than to do some search on their own.Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.
-
06-16-2007, 08:02 PM #5083
Ok, I am trying to use Dev-cpp as my development environment but I'm getting problems. First I get a message saying no GNU Make found and it asks me if I want to use the one in Dev-cpp. Then I go to compile and it says /lib/build.mak no file or directory found. Help?
Current releases:
Icon Action Replacer v1.5- latest release
Current projects:
PSP C++ IDE - Currently v1.6
RPG Paradise - Latest version at my website
-
06-16-2007, 10:25 PM #5084Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
that error get you when you dindt install toolchain fine in cygwin
-
06-17-2007, 09:31 AM #5085
I think its because the PSPSDK var has to be set. How do you do that in Dev-cpp?
Current releases:
Icon Action Replacer v1.5- latest release
Current projects:
PSP C++ IDE - Currently v1.6
RPG Paradise - Latest version at my website
-
06-17-2007, 10:38 AM #5086QJ Gamer Blue
- Registriert seit
- Apr 2007
- Ort
- Relative
- Beiträge
- 135
- Points
- 3.679
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Ok I'm going nuts here.
Why is this happening?
This function is supposed to replace '\n' and '\t' with with just those letters in a string.Code:void escape(char s[], char t[]) { char c; int i; i = 0; while((c = t[i]) != '\0'){ switch (c){ case '\n': s[i] = '\\'; ++i; //<---- A s[i] = 'n'; break; case '\t': s[i] = '\\'; ++i; //<---- B s[i] = 't'; break; default: s[i] = t[i]; ++i; break; } } s[i] = '\0'; }
So
after the function should beCode:This is a string that uses a new row
all i get isCode:This is a string \nthat uses a new row
When it gets to points A or B it just doesn't increment? It tried ++i, i++, i += 1 and nothing seems to work!Code:This is a string \that uses a new row
I wasted this entire day trying to figure out whats wrong. Someone please help. I know its something retarded.
TIA
-
06-17-2007, 10:49 AM #5087QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Break out a debugger on your PC and step through the code. The mistake should jump right out. Better yet, get a pen and paper and manually go through the algorithm yourself line by line taking extra attention on what t[i] is at the beginning of every loop.
There is one large logic flaw with that algorithm, you are trying to put two chars in the place of one which doesn't work with raw arrays. Either use the C string library and the insert function or the C++ string class.
If you stick with the C string method then be careful of over running the buffer.[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
06-17-2007, 11:10 AM #5088QJ Gamer Blue
- Registriert seit
- Apr 2007
- Ort
- Relative
- Beiträge
- 135
- Points
- 3.679
- Level
- 38
- Downloads
- 0
- Uploads
- 0
OMG i'm an idiot. Thank you yaustar. :ROFL:
I'm moving s[i] and t[i] at the same time, so when I try to insert '\\' and 'n' basically I'm jumping over t each time, that would explain the missing letter.
:Argh:
Thank you again, I like answers that make me think.
Spoiler for NEW CODE:
-
06-17-2007, 09:28 PM #5089QJ Gamer Bronze
- Registriert seit
- May 2006
- Beiträge
- 57
- Points
- 4.706
- Level
- 43
- Downloads
- 0
- Uploads
- 0
I have c++ for dummies 5th edition plus the iso of the cd included with it. But is there more approfounded things for a beginner who wants to learn to program with c++? Is there a software that can allow the user to use immediately what he has learned by that same software through some practice programming. exercices?
-
06-17-2007, 09:35 PM #5090
When u read the book, it tells you that there is a compiler on the CD and that is what you use to compile your exercises.
Current releases:
Icon Action Replacer v1.5- latest release
Current projects:
PSP C++ IDE - Currently v1.6
RPG Paradise - Latest version at my website
-
06-18-2007, 04:58 AM #5091QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- England ~¦¦¦|+|¦¦¦~
- Beiträge
- 1.112
- Points
- 9.165
- Level
- 64
- My Mood
-
- Downloads
- 0
- Uploads
- 0
In the makefile for your project, replace '(PSPSDK)/lib/build.mak' with the entire path, eg. 'C:/cygwin/usr/local/pspdev/psp/sdk/lib/build.mak' Worked for me.
Zitat von pspballer07
...Just Returned To The Scene...
-
06-18-2007, 10:40 AM #5092
I was going to do that but somehow it works now. thanks anyway
Current releases:
Icon Action Replacer v1.5- latest release
Current projects:
PSP C++ IDE - Currently v1.6
RPG Paradise - Latest version at my website
-
06-18-2007, 02:00 PM #5093QJ Gamer Silver

- Registriert seit
- Oct 2006
- Ort
- Pimp'en in the US F#
- Beiträge
- 1.254
- Points
- 7.278
- Level
- 56
- Downloads
- 0
- Uploads
- 0
its the Algorithm
Zitat von Raphael
NEWMy New BLOG!NEWThe Wentire Worls in two Sectors....When did I get dev statz?
Spoiler for my PSP homebrewReleases:Spoiler for Great Quotes:
-
06-18-2007, 02:52 PM #5094QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
Excuse me?
Zitat von BlackShark
Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.
-
06-18-2007, 07:44 PM #5095
lol "chicks with swords"
ask.com......Current releases:
Icon Action Replacer v1.5- latest release
Current projects:
PSP C++ IDE - Currently v1.6
RPG Paradise - Latest version at my website
-
06-18-2007, 07:56 PM #5096QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
How... irrelevant.
Zitat von pspballer07
-
06-18-2007, 08:11 PM #5097
its the commercial, just a joke
Current releases:
Icon Action Replacer v1.5- latest release
Current projects:
PSP C++ IDE - Currently v1.6
RPG Paradise - Latest version at my website
-
06-19-2007, 01:07 AM #5098QJ Gamer Silver

- Registriert seit
- Oct 2006
- Ort
- Pimp'en in the US F#
- Beiträge
- 1.254
- Points
- 7.278
- Level
- 56
- Downloads
- 0
- Uploads
- 0
Zitat von Raphael
NEWMy New BLOG!NEWThe Wentire Worls in two Sectors....When did I get dev statz?
Spoiler for my PSP homebrewReleases:Spoiler for Great Quotes:
-
06-19-2007, 04:40 AM #5099
- Registriert seit
- Jun 2007
- Beiträge
- 2
- Points
- 3.158
- Level
- 34
- Downloads
- 0
- Uploads
- 0
Hey.. Im trying to beging learning C++ can any1 tell me were i can get a good compiler? for a beginer? and were to download it from>?
-
06-19-2007, 05:13 AM #5100QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Don't go out to learn C++ if this is going to be your first programming language. Learn Python instead. It is MUCH easier to learn and less pitfalls in the language then C++. This means you can focus on the generic programming concepts and basics more then worrying about the language syntax. Tutorials can be found here
If you still want to learn C++ first then grab wxDevCpp which is a much more up to date and maintained version of DevCpp. Then get this book: Teach yourself C++ in 21 days. It is one the best beginners books I have seen to date. Do not read the online version that I found (Second edition and lower) since it was written before the C++ standard and therefore teaches 'wrong' C++ code.[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]


LinkBack URL
About LinkBacks
Mit Zitat antworten


Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum