Questions tagged as 'c'

2
answers

Function FWRITE is not writing in binary format in C language

I am not able to write data in binary to a file using the C language. Even using 'wb' the output of the file are characters. How can I proceed? Here's part of my code: void cadastrar(void) { if((fp=fopen("Jogos.dat", "wb"))==NULL)...
asked by 18.05.2016 / 14:01
1
answer

Problem in condition to handle string

It was meant to work only with lowercase letters and when it came to symbols did not change, but they are being altered. What's the problem? #include <stdio.h> int main() { char texto[100]; int i = 0,j = 0,con,tam; printf("texto\n");...
asked by 18.10.2015 / 17:51
1
answer

Error: Undefined reference to 'sqlite3_open'

I am creating a software in C that uses SQLite 3 as a database, but when compiling the project Codeblocks returns me the following error message:    createdata.c || undefined reference to 'sqlite3_open' |       undefined reference to 'sqlite...
asked by 26.10.2015 / 23:18
2
answers

Doubt cast pointer

If you have a line like this: u_char variavel_teste struct teste *p ; p = (struct teste *)variavel_teste; What is the use of this, and what does it mean, can you give me an example program?     
asked by 26.10.2015 / 23:09
1
answer

Is it correct to clean an internal malloc to a function with it?

Well given the following code is easy to do memory management: Sample Code (in C): #include <stdio.h> #include <stdlib.h> int *criarValor(void){ int *valor = malloc(sizeof *valor); *valor = 10; return valor; }...
asked by 30.05.2015 / 17:45
2
answers

Errors with array manipulation in C

Using the following code: #include<stdio.h> #include<string.h> int main(){ //Declaração de Variáveis char jogo; char times[20][15] = {"Corinthians","Atlético-MG","Grêmio","Santos","São Paulo","Internacional","Sport","Palmeiras","Po...
asked by 10.11.2015 / 11:31
1
answer

Reading a sequence between 2 and a certain value of x

Good afternoon, I would like to know how I can create a vector that stores a sequence, that is, if I want the numbers between 2 and the user between x = 10, the values inside the vector are as vector [2, 10 ] = 2,3,4,5,6,7,8,9,10 ??     
asked by 24.04.2015 / 20:43
1
answer

Consume DLL C in VB6 or C #

I have a DLL (gbasmsb_library.dll) made available by Popular Pharmacy responsible for returning some functions to interact with this environment. Home I think it's a DLL written in C, I need to consume this DLL in VB6 or C # . In the progr...
asked by 12.02.2015 / 17:20
1
answer

Passing address to WriteProcessMemory

I'm trying to pass a memory address to WriteProcessMemory() , but this address should be typed by the user, I'm in doubt how can I do this, I tried with strings, wstring I was not successful. int isSuccessful = WriteProcessMemory(...
asked by 12.02.2015 / 07:05
1
answer

Sort vector of Char in C using selection method

I'm trying to sort a vector of char using the selection method (Seletion Sort), but it's returning the vector exactly the same, without even making a change. Can someone point me to where the error is in the code? void selectionSortChar(char v...
asked by 20.03.2015 / 01:37