F&A Diskussionen
html page
<form action="upload.PHP" enctype="multipart/form-data" method="post">
<input type =file name=kk>
<input type=submit>
</submit>
 PHP page
upload.PHP
<?PHP
$file=trim($_FILES['kk']['name'];
if(move_uploaded_file($_FILES['kk']['temp_name'],$folder.$file))
{
echo"<h1>file uploaded";
}
else{echo"<h1>not";}
?>
 0 Stimmen
 5 Antworten#include <iostream>
#include <bitset>
int main()
{
    int myDecimalNumber;
    std::cin >> myDecimalNumber;
    std::string binary = std::bitset<8>(myDecimalNumber).to_string(); //to binary
    std::cout<<binary<<"\n";
    unsigned long decimal = std::bitset<8>(binary).to_long();
    std::cout<<decimal<<"\n";
    return 0;
}
 2 Stimmen
 5 AntwortenPublic, static and void
 0 Stimmen
 2 Antwortencan someone please explain why this code keeps telling me complication error instead of outputting the value of speed.
#include <iostream>
using namespace std;
class myClass {
    public:
    void setcarspeed (int a){
        speed=a;
    }
    int getcarspeed(){
       return speed; 
    }
    private:
    int speed;
            };
int main() {
    myClass obj;
    obj.setcarspeed (40);
    cout<<obj.getcarspeed ;
    return 0;
}
 2 Stimmen
 3 AntwortenIn the code below the output is 2. This code is used in a challenge and I get an error when I select the answer 2. It accepts as correct the answer 1 which I believe is wrong. If you agree please thumbs up.
If you find any other errors please post them here!
#include <iostream>
using namespace std;
int main()
{
    for(int i=1; i>=1; i++) {
      if(i<1 || i>1){
         cout << i;
          break;
      }
        
    }
    return 0;
}
 8 Stimmen
 8 Antwortenwhat is tjis code problem!
#include <iostream>
using namespace std;
int main()
{
    int b = 5;
    int arr[b] = {11, 35, 62, 555, 989};
    int sum = 0; 
    for (int x = 0; x < 5; x++) {
        sum += arr[x];
    }
    cout << sum << endl;
    return 0;
}
 I cannot make an array using int variable in order to define array's element number!?
 1 Stimme
 7 Antworten#include <iostream>
using namespace std;
int sum(int a, int b=42) {
    int result = a + b;
    return (result);
}
int main() {
    int x = 24;
    int y = 36;
    //calling the function with both parameters
    int result = sum(x, y);
    cout << result << endl;
    //calling the function without b
    result = sum(x);
    cout <<  result << endl;
  return 0;
}
why is da last function cout 66 and not 48 isn't it suppose to add 24+24?
 1 Stimme
 6 Antwortenhelp
 -2 Stimmen
 5 AntwortenHeute heiß
Beginner question
 0 Votes
I need help to solve this
 0 Votes
Remove
 0 Votes
Project
 0 Votes
Engineer Cloud
 0 Votes
Lua?
 1 Votes