Click here to Skip to main content
14,331,669 members

C / C++ / MFC

 
PraiseRe: WM_MOUSEWHEEL message and the Touchpad Pin
Randor 14-Jun-19 2:00
professional Randor 14-Jun-19 2:00 
GeneralRe: WM_MOUSEWHEEL message and the Touchpad Pin
Richard MacCutchan14-Jun-19 3:07
protectorRichard MacCutchan14-Jun-19 3:07 
QuestionC++ Callback process is dea Pin
Member 1422104112-Jun-19 23:05
memberMember 1422104112-Jun-19 23:05 
AnswerRe: C++ Callback process is dea Pin
Victor Nijegorodov12-Jun-19 23:18
memberVictor Nijegorodov12-Jun-19 23:18 
GeneralRe: C++ Callback process is dea Pin
Member 1422104112-Jun-19 23:48
memberMember 1422104112-Jun-19 23:48 
SuggestionRe: C++ Callback process is dea Pin
David Crow13-Jun-19 7:45
memberDavid Crow13-Jun-19 7:45 
GeneralRe: C++ Callback process is dea Pin
Victor Nijegorodov13-Jun-19 10:24
memberVictor Nijegorodov13-Jun-19 10:24 
QuestionProblem using strings Pin
Rodrigo Lourenço7-Jun-19 11:01
memberRodrigo Lourenço7-Jun-19 11:01 
I'm trying to change a given string in a function, but I send a string, try to change it directly and get a core dump, so I tried to create a string in the function, but it doesn't send the correct string.

This function must eliminate all Capital letter's it's a simple one, but I am making a mistake and don't see where.

Can any one help me please.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#define false 1
#define true 0

char* my_strdelupper(char* s){

      int i,j, len;
      char aux[100];
      char debuging;

      len = strlen(s);
      j = 0;
      for (i = 0; *(s + i) != '\0' < len; i++){
          if (!isupper(*(s+i))){
              printf("%c",*(s+i));
              debuging = *(s + i);
              *(aux + j) = debuging;
             j++;
          }
      }
      *(aux + j) = '\0';
      printf("\n");
      puts(aux);

      return strcpy(aux, aux);
}

int main()
{
  char *s3="Quem quer casar com um programador?";
  printf("%s\n",my_strdelupper(s3)); /* aria, sabes que é s o meu "rande mor " */

  return 0;
}

AnswerRe: Problem using strings Pin
Victor Nijegorodov7-Jun-19 11:26
memberVictor Nijegorodov7-Jun-19 11:26 
GeneralRe: Problem using strings Pin
Rodrigo Lourenço7-Jun-19 23:55
memberRodrigo Lourenço7-Jun-19 23:55 
GeneralMessage Closed Pin
11-Jun-19 2:34
memberMember 1449432111-Jun-19 2:34 
AnswerRe: Problem using strings Pin
k50547-Jun-19 11:39
memberk50547-Jun-19 11:39 
GeneralRe: Problem using strings Pin
Rodrigo Lourenço8-Jun-19 0:03
memberRodrigo Lourenço8-Jun-19 0:03 
SuggestionRe: Problem using strings Pin
David Crow7-Jun-19 16:50
memberDavid Crow7-Jun-19 16:50 
GeneralRe: Problem using strings Pin
Rodrigo Lourenço8-Jun-19 0:02
memberRodrigo Lourenço8-Jun-19 0:02 
AnswerRe: Problem using strings Pin
Joe Woodbury7-Jun-19 18:47
professionalJoe Woodbury7-Jun-19 18:47 
GeneralRe: Problem using strings Pin
Rodrigo Lourenço7-Jun-19 23:59
memberRodrigo Lourenço7-Jun-19 23:59 
AnswerRe: Problem using strings Pin
Richard MacCutchan7-Jun-19 21:52
protectorRichard MacCutchan7-Jun-19 21:52 
GeneralRe: Problem using strings Pin
Rodrigo Lourenço8-Jun-19 0:00
memberRodrigo Lourenço8-Jun-19 0:00 
AnswerRe: Problem using strings Pin
Rodrigo Lourenço8-Jun-19 0:05
memberRodrigo Lourenço8-Jun-19 0:05 
GeneralRe: Problem using strings Pin
jschell8-Jun-19 4:36
memberjschell8-Jun-19 4:36 
GeneralRe: Problem using strings Pin
CPallini9-Jun-19 22:41
mveCPallini9-Jun-19 22:41 
JokeRe: Problem using strings Pin
Peter_in_278010-Jun-19 1:41
professionalPeter_in_278010-Jun-19 1:41 
GeneralRe: Problem using strings Pin
CPallini10-Jun-19 5:51
mveCPallini10-Jun-19 5:51 
GeneralRe: Problem using strings Pin
John R. Shaw11-Jun-19 17:47
memberJohn R. Shaw11-Jun-19 17:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.