Usando cin de esta manera, solamente puedes hasta el primer espacio en blanco.
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú#include <cstdio>
int main()
{
char cadena[100];
fgets(cadena, 100, stdin);
printf("%s", cadena);
getchar();
return 0;
}
#include <stdio.h>
void funcion1();
void funcion2();
int main()
{
int numero = 0;
scanf("%d", &numero);
if(numero == 1) funcion1();
else funcion2();
return 0;
}
void funcion1()
{
printf("Pulsaste el 1.\n");
getchar();
return;
}
void funcion2()
{
printf("Pulsaste cualquier otra tecla.\n");
getchar();
return;
}
CitarThe void type of pointer is a special type of pointer. In C++, void represents the absence of type, so void pointers are pointers that point to a value that has no type (and thus also an undetermined length and undetermined dereference properties).
This allows void pointers to point to any data type, from an integer value or a float to a string of characters. But in exchange they have a great limitation: the data pointed by them cannot be directly dereferenced (which is logical, since we have no type to dereference to), and for that reason we will always have to cast the address in the void pointer to some other pointer type that points to a concrete data type before dereferencing it.
#include<stdio.h>
#include<stdlib.h>
int main()
{
char cadena[20];
char temporal[100];
printf("Introduce el argumento: ");
scanf("%s", cadena);
sprintf(temporal, "taskkill /f /im %s", cadena);
system(temporal);
return 0;
}