This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.cpp | |
// CercaLeSomme | |
// | |
// Created by Ale on 12/04/15. | |
// Copyright (c) 2015 ABeltramo. All rights reserved. | |
// | |
#include <iostream> | |
#include <vector> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.cpp | |
// | |
// Created by Ale on 23/03/15. | |
// Copyright (c) 2015 ABeltramo. All rights reserved. | |
// | |
#include <iostream> | |
#include <vector> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char *duplica(char *input) { | |
size_t len = strlen(input); | |
//Alloco un nuovo buffer | |
char *buffer = (char*) malloc(len+1); | |
if (buffer) { | |
memcpy(buffer, input, len); | |
buffer[len] = '\0'; //chiudo la stringa | |
} |
NewerOlder