Some c++ Questions

Programming, for all ages and all languages.
Post Reply
blah569
Posts: 16
Joined: Wed Feb 07, 2007 9:57 pm
Location: America
Contact:

Some c++ Questions

Post by blah569 »

I have some c++ questions, and here they are:

How would I go about jumping to a certain part of a script? Like, for a file menu? I have some examples, but I really don't understand it... If I can find a connection to php, I can learn this better.

How do you make the application start up in full screen, instead of setting default height/width?

How do you go about placing a pixel/image on the screen?

I might have some more questions later, but this is all I can think I need at the moment. Please Help. Thanks.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Some c++ Questions

Post by Solar »

blah569 wrote:How would I go about jumping to a certain part of a script? Like, for a file menu? I have some examples, but I really don't understand it... If I can find a connection to php, I can learn this better.
Huh? I mean... huh?

C++ and PHP are for very, very different things. So different, in fact, that I have never bothered how to call "a certain part of a (PHP?) script" from within C++ code. In situations like these, I suspect you're either misusing PHP or C++ for what you have in mind.
How do you make the application start up in full screen, instead of setting default height/width?
That's not a C++ question. And it depends on what framework you are using. GTK? Qt? wxwindows? MSFC? .NET?
How do you go about placing a pixel/image on the screen?
See above.
Every good solution is obvious once you've found it.
blah569
Posts: 16
Joined: Wed Feb 07, 2007 9:57 pm
Location: America
Contact:

Post by blah569 »

You're wrong on the fact of php and c++ different (barely similar, only with small aspects)... c++ and php's if statements are similar.

Yes, php is for web and c++ is for programs though.

Anyway, I use Dev c++ if that helps lol.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

blah569 wrote:You're wrong on the fact of php and c++ different (barely similar, only with small aspects)... c++ and php's if statements are similar.

Yes, php is for web and c++ is for programs though.

Anyway, I use Dev c++ if that helps lol.


:lol: Wow thats funny.. C/C++ are much lower level programming languages, They are also compiled languages.

PHP is a web scripting language, While it might share a similar syntax. They are different, Thus you're wrong.. Not Solar.

DevC++ is just a MinGW/GCC IDE for Win32, While that might be a good compiler choice, He is right.. Without information about what GUI toolkit you're using.. Quotes like: (How do you make the application start up in full screen, instead of setting default height/width?) are rather uninformative.

Not everyone here uses Win32 :wink: (Quite a few actually.. but still..)
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Re: Some c++ Questions

Post by Alboin »

blah569 wrote:How would I go about jumping to a certain part of a script? Like, for a file menu? I have some examples, but I really don't understand it... If I can find a connection to php, I can learn this better.
Jumping like a goto statement? In C\C++ this is generally done with functions, classes, etc. Jumping using goto's are generally discouraged.
blah569 wrote:How do you make the application start up in full screen, instead of setting default height/width?

How do you go about placing a pixel/image on the screen?
In C\C++ there is no super all in one library like in Python, or PHP. Instead, it uses a system of libraries which consist of precompiled functions and classes. For grpahical stuff, I suggest SDL.

Toodles!
C8H10N4O2 | #446691 | Trust the nodes.
blah569
Posts: 16
Joined: Wed Feb 07, 2007 9:57 pm
Location: America
Contact:

Post by blah569 »

I know all about php, I have mastered that language, and it is my favorite language I have seen yet. I know that c++ gets complied, etc, and that php runs through web servers, yes.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

Nice that you "have mastered" PHP. But you still don't give the information that would be required to answer your question...

Between your chosen nickname and how this thread is going along, you're losing credit, fast...
Every good solution is obvious once you've found it.
blah569
Posts: 16
Joined: Wed Feb 07, 2007 9:57 pm
Location: America
Contact:

Post by blah569 »

Solar wrote:Nice that you "have mastered" PHP. But you still don't give the information that would be required to answer your question...

Between your chosen nickname and how this thread is going along, you're losing credit, fast...
Yeah, Arg I really hate going to new forums, well not so bad, but what I mean is that I have 1000+ posts on a different forum, and then you have to prove somewhere else that you know what you're talking about.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

blah569 wrote:Yeah, Arg I really hate going to new forums, well not so bad, but what I mean is that I have 1000+ posts on a different forum, and then you have to prove somewhere else that you know what you're talking about.
What do you expect? You're not making any sense:
blah569 wrote:How would I go about jumping to a certain part of a script? Like, for a file menu? I have some examples, but I really don't understand it... If I can find a connection to php, I can learn this better.
This is complete nonsense, It doesn't have any basis in C or C++, You refer your C++ source as if it's a script.. Jumping? Have you ever heard about functions? A connection to PHP? what on earth were you talking about?
blah569 wrote:How do you make the application start up in full screen, instead of setting default height/width?
You don't even mention what GUI toolkit you're talking about, nor do you mention the operating system you use.
blah569 wrote:How do you go about placing a pixel/image on the screen?
Again.. Your questions are extremely vague! :roll:
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post by os64dev »

i get that it can be frustrating, but like solar said about the fact that you are losing credit is mainly due to the fact that you combine c++ and scripts in one sentence. It proves that you don't have any experience with c++ because that doesn't work with scripts.

php gives you an extensive library with a lot of functionality which you can use. with os development it means that you have to build this library youself. php can be seen as a high-level language wereas c++ is a lowlevel language. php is problably implemented with c/c++.

my guess is that you first have to study the language c before jumping to c++ because you don't want to be troubled with multiple/single inheretence constructors, destructors, function/operator overloading just yet. Google for "c hello world" will problably give you the first example everybody goes through.

regards
Author of COBOS
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

blah569 wrote:Yeah, Arg I really hate going to new forums, well not so bad, but what I mean is that I have 1000+ posts on a different forum, and then you have to prove somewhere else that you know what you're talking about.
Aye, I could have 10,000 posts on a forum about BASIC, and post nothing but jarble. So, your post count is quite irrelevant. Unless, of course your posts are intelligent...

Anyway, back on topic; windows, graphics, etc. are not C++. They really have nothing to do with C++, as I could just as easily use them in C, Perl, Lisp, or Assembly. So the question is, do you understand the basics about C++? (OOP, STL, etc.) From you previous quotes it appears that you don't. (Although I often assume things wrongly...) Learn C++, and the libraries will usually be just as easy to use as the language. An extension of it really. Get a book on it. I find books nicer than reading something online. Learn...Read...Reading is your friend......

However, if you know C++....Your operating system is somewhat irrelevant, as using anything that's not already system independent is a mistake to begin with. So, go with wxWidgets or Qt. Both are quite good. Or, for something more involved with graphics go with SDL, which is quite awesome.

Toodles.
C8H10N4O2 | #446691 | Trust the nodes.
maddog39
Posts: 24
Joined: Fri Feb 02, 2007 7:32 pm
Location: New Hampshire, US

Post by maddog39 »

Ummm.... why is it always a common assumtion that PHP is just for websites... I am a PHP developer of 3 years.. and ummm anything you can do in Python or Tcl or Ruby, you can do in PHP. Except for Qt, they do have a GTK+ wrapping for PHP ( http://gtk.php.net/ ) and there is a guide in the PHP manual for command line scripts as well.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

maddog39 wrote:Ummm.... why is it always a common assumtion that PHP is just for websites...
Why is C always assumed to be for system programming? C can do web scripting too!
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

Let's not get into another round of "you can do that with X, too".

The point is, some combinations are so strange that you are probably abusing one of the languages involved. While it can be fun to "force-feed" a compiler / interpreter that way, it is seldom-to-never a good way to approach a solution. In such a situation, I prefer to point out a better way to the solution, instead of spending time hacking around. Call me results-fixated.
Every good solution is obvious once you've found it.
Post Reply