Instantly convert code snippets from Rust to C with our free online code converter. Transform your code easily and accurately.
We prioritize your code's security and privacy. Your code is not stored on our servers and is only temporarily processed for conversion. We use OpenAI's secure servers for the conversion process, ensuring your code remains confidential.
Rust is a multi-paradigm programming language focused on performance and safety, especially safe concurrency.
C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, with a static type system.
fn is_palindrome(s: &str) -> bool {
    let clean: String = s.chars()
        .filter(|c| c.is_alphanumeric())
        .map(|c| c.to_ascii_lowercase())
        .collect();
    
    clean.chars().eq(clean.chars().rev())
}
fn main() {
    println!("{}", is_palindrome("A man, a plan, a canal: Panama")); // true
    println!("{}", is_palindrome("race a car")); // false
}#include <stdio.h>
#include <string.h>
#include <ctype.h>
int isPalindrome(export const char* str) {
    char clean[1000];
    int j = 0;
    
    // Clean the string
    for(int i = 0; str[i]; i++) {
        if(isalnum(str[i])) {
            clean[j++] = tolower(str[i]);
        }
    }
    clean[j] = '\0';
    
    // Check palindrome
    int left = 0;
    int right = strlen(clean) - 1;
    while(left < right) {
        if(clean[left] != clean[right]) return 0;
        left++;
        right--;
    }
    return 1;
}
int main() {
    printf("%d\n", isPalindrome("A man, a plan, a canal: Panama")); // 1
    printf("%d\n", isPalindrome("race a car")); // 0
    return 0;
}fn bubble_sort(arr: &mut [i32]) {
    let n = arr.len();
    for i in 0..n {
        for j in 0..n - i - 1 {
            if arr[j] > arr[j + 1] {
                arr.swap(j, j + 1);
            }
        }
    }
}
fn main() {
    let mut arr = vec![64, 34, 25, 12, 22, 11, 90];
    bubble_sort(&mut arr);
    println!("{:?}", arr);
}#include <stdio.h>
void bubbleSort(int arr[], int n) {
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < n - i - 1; j++) {
            if(arr[j] > arr[j + 1]) {
                int temp = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = temp;
            }
        }
    }
}
int main() {
    int arr[] = {64, 34, 25, 12, 22, 11, 90};
    int n = sizeof(arr)/sizeof(arr[0]);
    
    bubbleSort(arr, n);
    
    for(int i = 0; i < n; i++) {
        printf("%d ", arr[i]);
    }
    return 0;
}Convert Rust to Python
Open ConverterConvert Rust to JavaScript
Open ConverterConvert Rust to TypeScript
Open ConverterConvert Rust to Java
Open ConverterConvert Rust to C++
Open ConverterConvert Rust to C#
Open ConverterConvert Rust to Go
Open ConverterConvert Rust to Dart
Open ConverterConvert Rust to Ruby
Open Converter Swift
SwiftConvert Rust to Swift
Open ConverterConvert Rust to Kotlin
Open Converter Scala
ScalaConvert Rust to Scala
Open ConverterConvert Rust to PHP
Open Converter R
RConvert Rust to R
Open Converter Haskell
HaskellConvert Rust to Haskell
Open Converter Julia
JuliaConvert Rust to Julia
Open Converter MATLAB
MATLABConvert Rust to MATLAB
Open Converter Lua
LuaConvert Rust to Lua
Open Converter Assembly
AssemblyConvert Rust to Assembly
Open ConverterConvert Rust to Perl
Open Converter Groovy
GroovyConvert Rust to Groovy
Open Converter Elixir
ElixirConvert Rust to Elixir
Open Converter F#
F#Convert Rust to F#
Open Converter Clojure
ClojureConvert Rust to Clojure
Open Converter Delphi
DelphiConvert Rust to Delphi
Open Converter