Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
C
Hi what is wrong with thiss code
Hi what is wrong with thiss code
Collapse
This topic is closed.
X
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
kol
#1
Hi what is wrong with thiss code
Jul 4 '07, 08:05 PM
visual C++ samples
http://visualcsamples.awardspace.co.uk/
visual c++ samples , algorithm ,collection of array, if statement , mod operator ,class samples
this code\\
#include <cstdlib>
#include <iostream>
using namespace std;
void const pring(const int r){
r++; ;
cout <<"R IS " << r<<endl;
}
int main(int argc, char *argv[])
{
const int b = 5;
pring(b);
system("PAUSE") ;
return EXIT_SUCCESS;
}
Andre Kostur
#2
Jul 4 '07, 08:05 PM
Re: Hi what is wrong with thiss code
kol <hawash2@gmail. comwrote in news:1183579126 .682925.36940
@w5g2000hsg.goo glegroups.com:
#include <cstdlib>
#include <iostream>
>
using namespace std;
>
void const pring(const int r){
r++; ;
>
cout <<"R IS " << r<<endl;
}
>
int main(int argc, char *argv[])
{
const int b = 5;
pring(b);
>
system("PAUSE") ;
return EXIT_SUCCESS;
}
>
>
Why? What do you think is wrong? Have you tried to compile it and see
what happens?
Comment
Post
Cancel
Victor Bazarov
#3
Jul 4 '07, 08:15 PM
Re: Hi what is wrong with thiss code
"kol" <hawash2@gmail. comwrote...
visual C++ samples
http://visualcsamples.awardspace.co.uk/
visual c++ samples , algorithm ,collection of array, if statement , mod operator ,class samples
this code\\
>
>
#include <cstdlib>
#include <iostream>
>
using namespace std;
>
void const pring(const int r){
r++; ;
'r' is constant in the context of this function. You can't use anything
that needs to be able to change 'r's value.
>
cout <<"R IS " << r<<endl;
}
>
int main(int argc, char *argv[])
{
const int b = 5;
pring(b);
>
system("PAUSE") ;
return EXIT_SUCCESS;
}
>
>
V
--
Please remove capital A's from my address when replying by mail
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment