web design

That has nothing to do with web design but I suppose.

 
int x; //Declaration 


1
2
3
int x = 10; //Assignment + Declaration

x = 20; //Assignment 


With a declaration, you're simply telling the compiler that you plan on using that variable later on. An assignment actually gives the variable data to hold.
for a function, the definition and declaration are distinct:

void foo();

void foo()
{
code();
}

for a variable, I am not sure this concept applies (in c++). If it does, I have never needed to acknowledge it.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>

extern int a ; // declaration

int main()
{
    extern int b ; // declaration

    std::cout << a+b << '\n' ; // 68
    // note: header <iostream> contains the declaration of std::cout
    // see: https://en.cppreference.com/w/cpp/header/iostream#Synopsis
}

int a = 23 ; // definition
int b = 45 ; // definition 
Another fake profile with the silly vacuous question easily answered with a google search, but with the all important spammy URL in the profile.
Another fake profile with the silly vacuous question easily answered with a google search, but with the all important spammy URL in the profile.


He must be legit, didn't you see his bio?
Obvious spam is obvious, should probably be removed. someone feel free to do it... but it looks like the profile is too old.

I also removed anand's post because it's literally just copy-paste w/ advertising profile. This is the whole "spam bait + reply" that is more rare than other types of spam but still obvious once you've seen enough.

Also, related: Pay attention to random profiles that will bump topics that are 2 weeks+ old to say inane garbage.
Last edited on
Topic archived. No new replies allowed.